• C

ESQLC rfmtdate() return error


As per my code, im retrieving few data from database and assigning to a cursor as below:

$char szEarlyShipDate[15];


EXEC SQL FETCH empcsr  INTO :host_name, :szEarlyShipDate;

/* the string in szEarlyShipDate is of the format "mm/dd/yyyy"
   I need to convert this to "dd/mm/yyyy" format using the function rfmtdate() */

iReturn= rfmtdate(*(int4 *) szEarlyShipDate, "dd/mm/yyyy",szTemp)

But iam getting the return value as "-1210"

Please validate my coding and let me know how i could convert the date format from "mm/dd/yyyy" to "dd/mm/yyyy"

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You don't need to use rmdyjul before?
You need to convert to an internal date/time format.
Check an example here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DeviVenkataAuthor Commented:
hI, I used rstrdate() before calling rfmtdat() as below                        
                        if( (errnum = rstrdate((char *)szEarlyShipDate,&i_EarlyShipDate) ) == 0){
                                if((iReturn=rfmtdate(i_EarlyShipDate, "mm.dd.yyyy",szTempEarlyShipDate)) >=0){

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.