Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

General Date in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ladybug - 08 Nov 2007 16:36 GMT
Can you not set an open criteria in a query for a field set to a General Date?

When I run my query with no criteria, entries are returned.
When I put [Enter Date] in the Criteria nothing is returned.  I have checked
the date to make sure it was just not my error, but the date is correct.  
I have also tried Like "*" &[Enter Date]& "*"
This did not work either.  Any thoughts of what I am doing wrong or if I
cannot search this way?
John Spencer - 08 Nov 2007 16:58 GMT
POST your SQL.  (View: SQL in design view)

Try
CDate([Enter Date])

Access may not be understanding your input as a date.  It could be changing
11/07/2007 to a small fraction (11 divided by 7 divided by 2007) which the
date field will then see as a date and time on December 20, 1899.

Another way to handle this is to declare the parameter

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2

Now Access will know that [Enter Date] is a datetime and not a string or a
expression to be calculated.

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Can you not set an open criteria in a query for a field set to a General
> Date?
[quoted text clipped - 6 lines]
> This did not work either.  Any thoughts of what I am doing wrong or if I
> cannot search this way?
Darren Bartrup - 08 Nov 2007 17:24 GMT
On top of what John said, it might be converting your date into American date
format - are you trying to put in 11 July 2007, or 7 November 2007?

Of course, if you're in America then that's not the problem :)

> POST your SQL.  (View: SQL in design view)
>
[quoted text clipped - 25 lines]
> > This did not work either.  Any thoughts of what I am doing wrong or if I
> > cannot search this way?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.