473,320 Members | 2,147 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,320 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 11112
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.