Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date in sql statement returns 0 or 1
Message
From
24/05/2011 10:24:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01511582
Message ID:
01511589
Views:
110
This message has been marked as the solution to the initial question of the thread.
>I have a select statement getting 3 date fields from a vfp table.
>
>
>SELECT 	IIF(EMPTY(incep_date), "", DTOC(incep_date)) AS incep_date, ;
>	IIF(EMPTY(anniv_date), "", DTOC(anniv_date)) AS anniv_date, ;
>	IIF(EMPTY(term_date), "", DTOC(term_date)) AS term_date ;
>FROM myTable ;
>INTO CURSOR myCursor
>
>
>The first 2 dates return as expected, the date data or an empty string. The 3rd (term_date) is returning a blank field or a 0 or 1. All fields are date type.
>
>This doesn't make sense. Anyone know what I'm missing here?
>
>Thanks!
>KP


try
SELECT 	padr(IIF(EMPTY(incep_date), "", DTOC(incep_date)), 10)  AS incep_date, ;
	padr(IIF(EMPTY(anniv_date), "", DTOC(anniv_date)) , 10) AS anniv_date, ;
	padr(IIF(EMPTY(term_date), "", DTOC(term_date)), 10)  AS term_date ;
FROM myTable ;
INTO CURSOR myCursor
>
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform