a simple query with date

  • Thread starter Thread starter Gonsior Andreas
  • Start date Start date
G

Gonsior Andreas

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 ;-)
 
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
 
Hi Gerald!

It's not my table, it's one of our customers. I know, that I should avoid
"date" or "time" as a column name. So now it's my problem to handle it. :-(

Well, I tried it, but it also didn't worked. Perhaps its depending on the
german date. I have to fix it later at our customer. I hope it will work.

Thanks!

Andreas

Gerald Stanley said:
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 ;-)


.
 
Back
Top