Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Deal with Numeric Date Fields in SPT
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01315165
Message ID:
01315171
Views:
19
This message has been marked as the solution to the initial question of the thread.
Or simpler
* VFP9
CAST(DTOS(dDate) AS int)
* Pre VFP9
INT(VAL(DTOS(dDate)))
>
>where field > 20070101 and field < 20080105
>
>
>
>
>
>
>PROCEDURE DTONUM()
>	LPARAMETERS dDate
>	LOCAL cDate
>	IF !EMPTY(m.dDate)
>		m.cDate = STR(YEAR(dDate),4,0) + PADL(ALLTRIM(STR(MONTH(m.dDate))),2,"0") + PADL(ALLTRIM(STR(day(m.dDate))),2,"0")
>	ELSE
>		m.cDate = "00000000"
>	ENDIF
>	RETURN VAL(m.cDate)
>	
>ENDPROC
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform