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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

between "dateA" and "dateB" not returning values 1

Status
Not open for further replies.

jeffmorl

Programmer
Mar 30, 2011
33
US
OK. I've been using "between "dateA" and "dateB" for a while now and have a situation where the records with dateB don't appear in the query results.

Here is the sql code I'm using;

SELECT T_DMZ_EQUIPMENT.ITEM, T_DMZ_EQUIPMENT.TRANS_DATE
FROM T_DMZ_EQUIPMENT
WHERE (((T_DMZ_EQUIPMENT.TRANS_DATE) Between #2/6/2012# And #2/9/2012#))
ORDER BY T_DMZ_EQUIPMENT.ITEM, T_DMZ_EQUIPMENT.TRANS_DATE;

I would think that the results would include all dates between 2/6/12 and 2/9/12 inclusive... The result gives the date range with the exception of 2/9/12.

What am I missing here?
Thanks in advance.
 
Does TRANS_DATE contain time value ?
You may try this:
SELECT ITEM, TRANS_DATE
FROM T_DMZ_EQUIPMENT
WHERE TRANS_DATE Between #2012-02-06 00:00:00# And #2012-02-09 23:59:59#
ORDER BY ITEM, TRANS_DATE

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PVH, it does have a time value.

I guess I've never had the need to include a time value, but this time I do.

 
So now the question is, How to get the user to enter the time parameter from a date picker.
 
From which time parameter are you talking about ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Nevermind. I figured it out.

Thanks for the clue about the TransDate having a time value to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top