473,230 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 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 11108
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products...
3
by: jen2007 | last post by:
I have several ranges of dates (2007-03-15 - 2007-03-21, format YYYY,MM,DD) and I need to list all of the dates in the range and not sure how to do this. I wrote an OnLoad procedure that should run...
3
by: girl | last post by:
i have this problem m using dataset dataadapter and dataset i would like to select a date range using a datetimepicker or monthcalendar. the data in my database for date is 05/01/2007 where 05...
3
by: Tarena | last post by:
I have a report that is generated by a query. I have a form with a calendar control. I would like to use the form to force my date range to generate my report. Any suggestions? Do I need to give...
3
by: tonymcc | last post by:
Hi all I am having a head bursting nightmare trying to get a query to work, I will try and explain. I have developed a database for the calculating storage costs in a warehouse. Customers are...
2
anoble1
by: anoble1 | last post by:
Hey I am wanting to reset a date range to lets say 1/1/2008 - 12/31/2008. So when I click on reset i want it to bring those values up and limit everything by them. That way it brings up every...
19
by: phill86 | last post by:
Hi I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different question from the initial thread. here is the...
4
by: heart01 | last post by:
I find myself here again...I am using access 2007 and I have three Reports. What I am thinking I would like to do is have a single list box.combo box? whereby I can select a report and then be able...
2
by: Lisa B | last post by:
I have managed to create a Report from a form that displays data per date In the query criteria for the date it references the form !! The report is based on the results of the query as per...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.