Problem with ASP/Access DB

Problem with ASP/Access DB

am 06.01.2007 14:43:56 von klausi klaus

Hi,

I'm using the following SQL Statementbut i won't work.
I allready tried different types of date (YY/MM/DD and others).
The "date" Filed is formatted as Time/Date Field in Access.

SELECT * FROM WHERE date > '31.12.2006' ORDER BY Datum DESC

Anyone got an idea what might be the problem and how to solve ?

Jens

Re: Problem with ASP/Access DB

am 06.01.2007 14:54:15 von reb01501

AfterLife wrote:
> Hi,
>
> I'm using the following SQL Statementbut i won't work.

Please describe your symptoms without using the meaningless "won't work"
mantra.

> I allready tried different types of date (YY/MM/DD and others).
> The "date" Filed is formatted as Time/Date Field in Access.
>
> SELECT * FROM WHERE date > '31.12.2006' ORDER BY Datum DESC
>

Date literals have to be delimited with octathorps (#). In Jet, they should
use the YYYY-MM-DD format.
Of course, if you use parameters, then you don't have to worry about sql
injection or delimiters:

http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/microsoft.public.inetser ver.asp.db/msg/72e36562fee7804e

Personally, I prefer using stored procedures, or saved parameter queries
as
they are known in Access:

Access:
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&sel m=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl





--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Solved the Problem

am 06.01.2007 15:23:46 von klausi klaus

Hi,

I solved the Problem.
Now I'm using the following SQL Statement and it works like expected.
Thanks for help so far.

SELECT * FROM

WHERE YEAR(date) = 2007 ORDER BY Datum DESC


Jens