Subject | Converting String to a date via CAST errors out? |
---|---|
Author | Chris Voronin |
Post date | 2006-04-21T19:23:08Z |
Hi everyone,
Does Firebird have a function I can use to convert string to date. The
string is formatted as YYYYMMDD. And when I run the following function I
get an error because I didn't specify the format. So ladies and gentlemen
is there a way to do this in firebird?
Here is the code I tried to run:
update PATIENT_TABLE
set DATE_OF_BIRTH = CAST (CAT1 AS DATE);
Here is the error received:
ISC ERROR CODE:335544334
ISC ERROR MESSAGE:
conversion error from string "19460705"
I even tried things like CAST(CAT1 AS DATE"YYYYMMDD") or CAST(CAT1 AS
DATE(YYYYMMDD)) none of these work, they just tell me unknown token because
that's now how this function is designed to work.
Thanks for any advice.
Chris V.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Richard Thomas
Sent: Friday, April 21, 2006 11:04 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Script Won't Work
Hi All:
The Following script is being loaded, will run, create the output file but
the output file is empty.
Any Suggestions?
/* Start Script */
OUTPUT C:\RtFbISQLLog.rtf ;
HELP ;
OUTPUT ;
QUIT ;
/* End of Script */
Rick Farmington Mich. USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
Does Firebird have a function I can use to convert string to date. The
string is formatted as YYYYMMDD. And when I run the following function I
get an error because I didn't specify the format. So ladies and gentlemen
is there a way to do this in firebird?
Here is the code I tried to run:
update PATIENT_TABLE
set DATE_OF_BIRTH = CAST (CAT1 AS DATE);
Here is the error received:
ISC ERROR CODE:335544334
ISC ERROR MESSAGE:
conversion error from string "19460705"
I even tried things like CAST(CAT1 AS DATE"YYYYMMDD") or CAST(CAT1 AS
DATE(YYYYMMDD)) none of these work, they just tell me unknown token because
that's now how this function is designed to work.
Thanks for any advice.
Chris V.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Richard Thomas
Sent: Friday, April 21, 2006 11:04 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Script Won't Work
Hi All:
The Following script is being loaded, will run, create the output file but
the output file is empty.
Any Suggestions?
/* Start Script */
OUTPUT C:\RtFbISQLLog.rtf ;
HELP ;
OUTPUT ;
QUIT ;
/* End of Script */
Rick Farmington Mich. USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links