|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem with SQL query
i have the following query in Access DB
Code:
SELECT COUNT(fldDate) AS c FROM tblSchedule WHERE fldDate=2/5/2004; now fldDate in tblSchedule has the data 02/05/2004 (SHORT DATE format) however the query brings back a result of 0, when it should bring back 1. i have tried the american format date in the query (5/2/2004) but it still results 0. anyone know why this does not bring back a result of 1 ?? |
|
#2
|
|||
|
|||
|
Try putting #between your date :
example : flddate=#02/01/2004# |
|
#3
|
|||
|
|||
|
yeah that seems to make it work now...
however it only works when the date in the query is in the US format.... even though the date is in UK format in the actual record. is it possible to make the query work with UK format date..ie dd/mm/yyyy ? |
|
#4
|
|||
|
|||
|
I don't believe that it is possible, directly in a query,
However, if you create a froms with a text box (that is formated with a UK date format) and pass the value entered into the text box into the query, in theory it should work (at that stage a date is a date and access will know how to interpert it.) Give it a try S- |
|
#5
|
|||
|
|||
|
that's what i am doing.. passing it thru a form... however the forms passes thru a UK date... ie 2/5/2004... the query doesn't match that in the DB .. as it only seems to match 5/2/2004 !
|
|
#6
|
|||
|
|||
|
I'm assuming that the regional settings on your computer is set to UK date format correct?
S- |
|
#7
|
|||
|
|||
|
yes that is correct.
|
|
#8
|
|||
|
|||
|
While I'm thinking about this..
What part of Scotland? S- |
|
#9
|
|||
|
|||
|
north ayrshire.
|
|
#10
|
|||
|
|||
|
Just curious,
My Grandparents are from Scotland Grandpa - around Glasgow Grandma - around Edinburgh Sorry - look at following article (you have to convert dates to US formats) Microsoft Knowledge Base Article - 210069 S- |
|
#11
|
|||
|
|||
|
hmm.. sounds nasty!!!
not keen on changing the dates to US format ! afterall.. it is a UK film schedule the page is displaying (ASP) so i don't want it showing US dates ! |
|
#12
|
|||
|
|||
|
You dont' have to display them, just use them
Good Luck S- |
|
#13
|
|||
|
|||
|
i'm confused now
![]() |
|
#14
|
|||
|
|||
|
You program the interface to show and display the dates in UK format. Then you use a function to convert them to US format for querying purposes only (everything behind the scenes).
S- |
|
#15
|
|||
|
|||
|
hmm.. will have to sit down and think that one thru..
i am not *that* clued up on access yet ! |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > problem with SQL query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|