HI ,
I am using this
cast(cast((extract(month,current_date)), varchar(2)), integer)-1||'/'||cast(substring((cast((extract(year,current_date)), varchar(4)) ),3), integer)-1
in a if and else i am getting the 'sqlPrepareWithOptions' status='-126'
but without having it in the if condition if i=run the tabular data i am getting required output .
But within the below if condition i am getting the below mentioned error
IF (cast((extract(month,current_date)), varchar(2))>'01')
THEN
(cast((extract(month,current_date)), varchar(2))||'/'||substring((cast((extract(year,current_date)), varchar(4)) ),3))
ELSE
(cast(cast((extract(month,current_date)), varchar(2)), integer)-1||'/'||cast(substring((cast((extract(year,current_date)), varchar(4)) ),3), integer)-1)
Please guide on this
Looks to me you are trying to concatenate ( || ) strings and numerical values
Also why define:
(cast((extract(month,current_date)), varchar(2))>'01')
instead of:
extract(month,current_date) > 1
You need to clean your code..
Thanks Bloom0344 :)
You're welcome! Now if you could just write my name properly ;)
Sorry :) for not writing ur name properly blom0344
Quote from: blom0344 on 19 Dec 2011 01:44:35 AM
You're welcome! Now if you could just write my name properly ;)
Hee hee. Makes me smile every time! :)
Thanks Blom - you are a star!
I fear this is becoming a running gag :-\