Re: how to handle date in ESQL/C
Posted in 1995
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <JASWANT.95Jun14114346@highland.eng.octel.com> jaswant@highland.eng.octel.com (Jaswant Bhardwaj) writes: >Hi, > I'm new this group and also new to ESQL/C. I have problem with >the date field in the following program. When i execute this, i get >sqlcode of 1205 which says, invalid month in date. > > How do i declare 'r_now' and 'r_date_needed' variables so that the >esql accepts them. The values for r_now is 6/14/95 and r_date_needed >is 7/13/95. > >Please help, appreciate it. > >jaswant [stuff deleted] date is of type long and not char *. a simple assignment of var_type_long = var_type_char won't do it. look at todate() function in ctools.h or also rstrdate() convert a string to an internal format I tried sending you an example but the e-mail kicked back. Let me know your e-mail address if you still have problems figuring it out and I'll be glad to show you how to do it... Bob Beaulieu bobb@netcom.com -- ___________________________________________________________________ | _____ _____ ______ _____ _____ ___ ___ _____ __ | || ___| |_ / |_ _|| _ \\ / _ \\ \\ \\/ / | ___| | | | || ___| / /_ | | | / | _ | \\ / | ___| | |__ | ||_____| /_____| |__| |__|__\\ \\_/ \\_/ \\__/ |_____| |_____| | |$Best Fares$...........Great Service........International/Domestic | |Tel(408)978-0808 Fax:(408)978-7024 Internet: eztravel@netcom.com | -------------------------------------------------------------------