471,319 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

MS Access SQL Select command in date range problem

Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
[PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
#5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
PoHead.TranDate, PoHead.SupplierCode, PoHead.ProjectCode, PoItem.StockCode

When

Date1 = #5/10/2005#

Date2 = #9/10/2005#

the command no record selected but when Date2 = #10/10/2005#, the record for
#6/10/2005# will capture.

What is the problem ?


Dec 16 '05 #1
3 11024
Tsair wrote:
Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
[PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
#5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
PoHead.TranDate, PoHead.SupplierCode, PoHead.ProjectCode, PoItem.StockCode

When

Date1 = #5/10/2005#

Date2 = #9/10/2005#

the command no record selected but when Date2 = #10/10/2005#, the record for
#6/10/2005# will capture.

What is the problem ?

you should check out if you are using the right date-format mm/dd/yyyy
or dd/mm/yyyy

the representation in sql can be different from the database
Dec 16 '05 #2
How to set the date both in sql and database are in same format ?

i am using ACCESS database
"Franky" <dr***@bestopia.be> wrote in message
news:11***************@seven.kulnet.kuleuven.ac.be ...
Tsair wrote:
Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
[PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
#5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
PoHead.TranDate, PoHead.SupplierCode, PoHead.ProjectCode,
PoItem.StockCode

When

Date1 = #5/10/2005#

Date2 = #9/10/2005#

the command no record selected but when Date2 = #10/10/2005#, the record
for #6/10/2005# will capture.

What is the problem ?

you should check out if you are using the right date-format mm/dd/yyyy or
dd/mm/yyyy

the representation in sql can be different from the database

Dec 17 '05 #3
Can you post a small but working example of the relevant code?

--

Derek Davis
dd******@gmail.com

"Tsair" <ls*****@yahoo.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
[PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
#5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
PoHead.TranDate, PoHead.SupplierCode, PoHead.ProjectCode, PoItem.StockCode

When

Date1 = #5/10/2005#

Date2 = #9/10/2005#

the command no record selected but when Date2 = #10/10/2005#, the record
for #6/10/2005# will capture.

What is the problem ?

Dec 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Thomas R. Hummel | last post: by
3 posts views Thread by girl | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.