Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to search for date range????? 1

Status
Not open for further replies.

JasonLiew

Programmer
Oct 15, 2001
37
SG
Hi all,

Do u guyz know how to search and show dates between dateA and dateB? Does access itself has this function?

[sadeyes]
Regards,
Jason.
 
If it is in a query or SQL statement then use the format

"BETWEEN #" & DateA & "# AND #" & DateB & "#"

The # marks are date format delimiters that tell Jet to interpret the data as dates


One warning though.
Jet always interprets dates in dd/mm/yy format in the American order ( mm/dd/yy ) regardless of the local settings on your machine so DateA & DateB should be strings containing the month in text to prevent errors.


G LS
 
We have a DB that uses just this function. The dates are held on the table in the format dd/mm/yyyy, and entering the search dates in this format workes just fine. The query we use also asks for the date parameters to be put in at run time. the criteria for this is:

Between [ 'Please enter from date:'] And [ 'Please Enter to date:']

Put this in the criteria of the date field

hth

Tony
 
Hey!

It works!
Wow.... amazing.
Thank you guyz.
Me not so good in Access.
Thank you.[bigsmile]

Jason.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top