Board index » delphi » URGENT!!! Timestamp format in WHERE Clause

URGENT!!! Timestamp format in WHERE Clause

I have created a Delphi Front End to access data stored on an AS400. The
tables I need are very large and hold up the server so am using a
batchMove to create a temporary table (.DB) using the Database Desktop
on the local PC.
However,  one of the fields (XJStamp) is a Timestamp field and I have
loaded a combo box with all the available timestamps to enable the user
to select the Date/Time for the data that they want to access.

The following SQL
                            select * from 'D:\tblXJ.db'
                            where xjstamp = '2002-07-15-06.00.01'

works fine on the AS400 but gives 'Type Mismatch in Expression' in the
Database Desktop. The field in the Desktop is displayed as '06:00:01,
15/7/02' however, that doesn't work either. I don't know what format to
use as there is no DATE(xjstamp) function available in the desktop. Can
you help???

 

Re:URGENT!!! Timestamp format in WHERE Clause


The easiest way to work with dates and times in queries is to use a
parameterized query and assign the timestamp value to the parameter so
Delphi takes care of any necessary format conversion.

On Wed, 17 Jul 2002 23:54:10 +1200, Steve Griffin

Quote
<griff.n...@clear.net.nz> wrote:
>I have created a Delphi Front End to access data stored on an AS400. The
>tables I need are very large and hold up the server so am using a
>batchMove to create a temporary table (.DB) using the Database Desktop
>on the local PC.
>However,  one of the fields (XJStamp) is a Timestamp field and I have
>loaded a combo box with all the available timestamps to enable the user
>to select the Date/Time for the data that they want to access.

>The following SQL
>                            select * from 'D:\tblXJ.db'
>                            where xjstamp = '2002-07-15-06.00.01'

>works fine on the AS400 but gives 'Type Mismatch in Expression' in the
>Database Desktop. The field in the Desktop is displayed as '06:00:01,
>15/7/02' however, that doesn't work either. I don't know what format to
>use as there is no DATE(xjstamp) function available in the desktop. Can
>you help???

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads