Re: a simple query with date

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

From: Gerald Stanley (gcstanley_at_d-s-l.pipex.comREMOVE-)
Date: 09/24/04


Date: Fri, 24 Sep 2004 11:57:43 -0700

date is a reserved word in Access and should be avoided as
a column name (as is time). If you do use it, it should be
enclosed in [] to differentiate from the function date(). Try
select * from results where [date] > #09/14/2004# order by
[date]

Hope This Helps
Gerald Stanley MCSD
>-----Original Message-----
>Hi Newsgroup!
>
>I've got a litte problem with an sql statement, I'm
sending to an access mdb
>by an C++-Application, to get "a newer value than the last
one".
>The columns of the table "Results" looks like this:
>id, date, time, value1, value2, value3, ... valueN
>
>I made an SQL Statement:
>select * from results where date > datevalue('14.09.2004
15:00:00') order by
>date
>But when I get this recordset, I have as the first value
again that one with
>date = '14.09.2004 15:00:00' in it. Is it to near at the
weekend, am I blind
>or what is going on here? :-(
>I tried it also with "select * from results where date >
'14.09.2004
>15:00:00'" but it didn't worked, too. And a look into the
MSDN didn't helped
>either.
>
>Thanks in advance!
>
>Andreas
>
>P.S.: It's very urgent, I need a solution for that problem
on Monday and I
>spend the whole day here at work to solve it. And NO, it's
not a homework
>for school or something else ;-)
>
>
>.
>



Relevant Pages

  • a simple query with date
    ... I've got a litte problem with an sql statement, I'm sending to an access mdb ... And NO, it's not a homework ...
    (microsoft.public.access.queries)
  • RE: Fetch without Execute...
    ... If you fix the execute, ... Is key a reserved word in MySQL? ... Also, you should be using placeholders, or at least DBI->quote, instead ... of interpolating external data directly into an SQL statement. ...
    (perl.dbi.users)
  • Re: ADOCE error
    ... reserved word or name has a space, but I do not see anything like this in ... Is it actual SQL statement? ... >I m using ADOCE for pocket pc and using update command for database access. ...
    (microsoft.public.data.ado)
  • RE: help with SQL queries
    ... index is a reserved word, you shouldn't use it in an sql statement as a variable name ... "agassi" wrote: ... > Model, YearAcquired, Price, Description FROM CompanyAssets WHERE ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Error in the from clause
    ... There are two conventions that have been broken ... Date is a reserved word and if you insist on using ... The ON clause should be provided in the same order as ... >Can AnyOne see here where the error in the sql statement is ...
    (microsoft.public.access.forms)