Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Deal with Numeric Date Fields in SPT
Message
 
To
05/05/2008 14:48:29
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:
01315167
Views:
16
>I am trying to write a SPT that will retreive a set of records between two dates. The remote data base fields are numeric(20080505) for example. What does my SPT need to be for say records > 01/01/2007 and < 01/05/2008?


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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform