Re: Noob question - Data Type Mismatch

Tech-Archive recommends: Fix windows errors by optimizing your registry



<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





.



Relevant Pages

  • RE: Excel & MS Query caused compile errors
    ... My data is in an Excel file called ... The format of it were distorted after copying and pasting. ... Microsoft SQL Server 2000, which requires a server, VBA or Microsoft Query ...
    (microsoft.public.excel.programming)
  • Re: mySQL Problem
    ... And when the query gets executed i get back the following error: ... Actually, problem is proper quoting, not the format or anything else. ... the SQL standard and won't work on any other RDBMS I'm familiar with. ... you admit that mssql uses something DIFFERENT and PARTICULAR to alias? ...
    (comp.lang.php)
  • Re: VBA ADO SQL Query Problem
    ... For long queries on a Oracle DB, I often meke it easy by using Business ... Object where I copy the SQL statement from. ... query parameter in the Oracle date format. ... But the query DID work, only no records were retrieved ...
    (microsoft.public.excel.programming)
  • Re: Format issue ... 2 decimal places displayed?
    ... Jeanette Cunningham wrote: ... to get sql of your query, open the query in design view, then select Query | SQL view from the menu. ... you applied the format to the combo box. ...
    (microsoft.public.access.forms)
  • Re: dhCountWorkdaysA help
    ... I have changed the format of the date constants in the query as you advised, ... view of my source data table to resolve the data type mismatch, ... criteria expression' when I specify holiday dates. ...
    (microsoft.public.access.queries)