Re: Noob question - Data Type Mismatch
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Sat, 27 Jan 2007 09:02:40 -0600
<tokersmurf@xxxxxxxxx> wrote in message
news:1169909794.502398.104640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
I am fairly new to SQL and am running into a problem I can't figure
out. Hopefully someone here can help. To be honest im not even sure
if
this is the right place for the query so if not then let me know
where
I should put this question:
I have an Access database which I am trying to run the following
query
against:
DELETE From Basket WHERE CreatedAt < '26/01/2007 14:20:49'
The DB has a table called BASKET which in turn has a column called
"CreatedAt". The column is set to be a date and contains a row with a
CreatedAt date of "25/01/2007 14:11:45".
As far as I can tell this should work but when I run the above
statement, I get a "Data Type Mismatch in criteria expression" error.
Any help or pointer would be appreciated
In Access queries dates are delimited with # rather than '. You also have to
use either US format or a non-ambiguous format...
DELETE From Basket WHERE CreatedAt < #01/26/2007 14:20:49#
Your non-US format would work with the specific date value you specified because
the day value was greater than 12, but whenever that is not the case Access
would have assumed that the first part was the month.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
.
- References:
- Noob question - Data Type Mismatch
- From: tokersmurf
- Noob question - Data Type Mismatch
- Prev by Date: Re: Noob question - Data Type Mismatch
- Next by Date: Re: Noob question - Data Type Mismatch
- Previous by thread: Re: Noob question - Data Type Mismatch
- Next by thread: Re: Noob question - Data Type Mismatch
- Index(es):
Relevant Pages
|