Subject | Re: Select statement with Date |
---|---|
Author | kfkong |
Post date | 2004-06-08T01:40:01Z |
--- In firebird-support@yahoogroups.com, "paul" <paulraj@s...> wrote:
Hi, my suggestion is you pass the today's date to a date variable
before setting it into the select statement. In the example above,
you are actually sending a text to a date column. As long as your
logoutdate is not a timestamp column then you will not need to use
CAST(logoutdate as DATE)...
Hope this will help you.
Peter
>is
> Hi,
>
> I have a some doubt about select statement using where clause
> datespecified
> Say, I have table with login and logout Date fields,
>
> I need to select the persons whoever logout todays or any of
> dates.(todayCal.getTimeInMillis());
>
> I am using
>
> GregorianCalendar todayCal = new GregorianCalendar();
> java.sql.Date today = new java.sql.Date
>Paul,
> "Select EmpName, EmpID from EMP where logoutdate='"+today+"';
>
> I didn't get any values, what is the correct statement for above
> situation.
>
>
> Regards,
> N.Paul
>
>
>
> [Non-text portions of this message have been removed]
Hi, my suggestion is you pass the today's date to a date variable
before setting it into the select statement. In the example above,
you are actually sending a text to a date column. As long as your
logoutdate is not a timestamp column then you will not need to use
CAST(logoutdate as DATE)...
Hope this will help you.
Peter