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.

Parameter Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pon - 06 Nov 2007 22:09 GMT
Iam using a parameter query using Between [Begin_date] and [End_date]
End_date should be inclusive - Correct?
If Yes, When my  parameter begin date is 03/28/2007 and end_date is 03/29/2007
It gives all the values from 03/28/2007 and 03/29/2007 to 03/29/1999.
What am I doing wrong? Please help.
Thanks
Pon
Allen Browne - 06 Nov 2007 22:55 GMT
Sounds like there is some confusion about the data type here.

1. The query is based on a table that has the date field.
Open that table in design view, and check that the field is of type
Date/Time, not Text. (If it is a text sort, you will get the wrong results.)

2. In query design view, choose Parameters on the Query menu.
In the parameter dialog, declare your 2 parameters, so Access knows their
type. The 2 rows will look like this:
   Begin_date        Date/Time
   End_date           Date/Time

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Iam using a parameter query using Between [Begin_date] and [End_date]
> End_date should be inclusive - Correct?
[quoted text clipped - 4 lines]
> Thanks
> Pon
John W. Vinson - 06 Nov 2007 22:57 GMT
>Iam using a parameter query using Between [Begin_date] and [End_date]
>End_date should be inclusive - Correct?
[quoted text clipped - 3 lines]
>Thanks
>Pon

Is the field a Date/Time field? My guess is that it's Text and that Access is
applying the "BETWEEN" alphabetically (03/anything comes before 04/anything)
rather than chronologically.

If that's not it, please open the query in SQL view and post the SQL text
here.

            John W. Vinson [MVP]
 
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.