|
-
Apr 29th, 2002, 05:47 AM
#1
Thread Starter
Hyperactive Member
This is unusual
VB Code:
SELECT A.referenceno, B.datetime
FROM defectiveitem AS A, exportorder AS B, customer AS C
WHERE A.exportorderid = B.id AND A.customerid = C.id AND C.name = 'SLT'
AND
(B.datetime >= '20/04/2001' AND B.datetime <= '21/04/2001')
ORDER BY B.id
When I run this query I don’t get the dates that are equal to '21/04/2001' even though there are data like that

i am using sql server 2000
-
Apr 29th, 2002, 05:51 AM
#2
you are using UK date format (dd/mm/yyyy), try using american format instead (mm/dd/yyyy), eg:
Code:
SELECT A.referenceno, B.datetime
FROM defectiveitem AS A, exportorder AS B, customer AS C
WHERE A.exportorderid = B.id AND A.customerid = C.id AND C.name = 'SLT'
AND
(B.datetime >= '04/20/2001' AND B.datetime <= '04/21/2001')
ORDER BY B.id
-
Apr 29th, 2002, 05:54 AM
#3
Thread Starter
Hyperactive Member
No Luck
-
Apr 29th, 2002, 05:55 AM
#4
Thread Starter
Hyperactive Member
i do get some of the dates 19,20 etc only 21 i don't get
-
Apr 29th, 2002, 05:59 AM
#5
Ah!! just realised it is a date-time field!!
when you don't specify a time it assumes midnight, so just set the parameters like this:
(B.datetime >= '04/20/2001' AND B.datetime < '04/22/2001')
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|