Paradox Community

Items in pnews.paradox-client_server

Subject:Re: SQL DATE + TIME
Date:Wed, 23 Sep 2020 11:28:18 -0500
From:Mark Bannister <markRemove@THISinjection-moldings.com>
Newsgroups:pnews.paradox-client_server
I think you are going to have to format them as strings and stick them 
together in the expected format.
In local SQL this works:  CAST('9/8/2020'|| ' ' || '01:02:03 AM' AS 
TIMESTAMP)
so you may need to cast your date and time as character and then stick 
them back together.

CAST(
   CAST(fldDate  AS CHARACTER(10))
   || ' ' ||
   CAST(fldDateTime  AS CHARACTER(10) )
) AS TIMESTAMP)

On 9/23/2020 10:49 AM, Thies Grimm wrote:
> Hi, in my table there are two fields, one date and one time field.
> I like to add these both values to a single field datetime.
> 
> SQL
>     SELECT (fldDate + fldTime) AS fldDateTime
> endSQL
> 
> doesn't work (Type mismatch in expression)
> 
> So I tried
> SQL
>     SELECT (CAST(fldDate AS TIMESTAMP)
>             + CAST(fldTime AS TIMESTAMP)) AS fldDateTime
> endSQL
> 
> Same error
> 
> So how do I do it?
> 
> Thanks
> 


Copyright © 2004 thedbcommunity.com