SQL query problem

Hi all,

I have a SQL query problem...

Let's have a table tblPeople with two columns. First one with name fldName of type VT_BSTRT, second one with name fldBirth of type VT_DATE.

User can enter a date in EditBox. So entered date is in the CString variable with name StrVar.

NOW THE QUESTION: How to create an SQL query to get all people, which birthday is greater then entered date?

THIS DOESN'T WORK: I try "SELECT * FROM tblPeople WHERE fldBirth > " + StrVar ... and it doesn't work. Something like parametr mischmasch in DaoException...

The example code will be helpfull.

Thanks...

PetrP.
[680 byte] By [PetrP] at [2007-11-17 23:50:56]
# 1 Re: SQL query problem
If you use Access then all dates and times you should wrap with #.

For example

"SELECT * FROM tblPeople WHERE fldBirth > #" + StrVar + "#";
alexey_1979 at 2007-11-10 8:46:53 >
# 2 Re: SQL query problem
Thanks.

I had already solved this problem by DateValue() Access function.

Petr P.
PetrP at 2007-11-10 8:47:54 >