Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null date to empty(and back again)
Message
From
25/08/2009 12:32:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/08/2009 12:10:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01420493
Message ID:
01420499
Views:
47
>I'm using local views without nulls, and blank dates are valid within the application. I'm considering going to remote views, but lack of an empty date, nulls and/or the automatic date entry are warping my little brain. Is there a fast and easy way to convert to blank VFP dates when using the view, and saving to the backend as null or whatever?
>
>Chris.

Using cursoradapter class you can define conversionfunc. ie:
Define Class Ca_MyTable As MyCaBase OF MyCAClasslib.prg
*...
	ConversionFunc = "MyDate E2N, MyChar TRIM"
*...
ENDDEFINE
and e2n.prg:
Lparameters tuValue
If Empty(m.tuValue) OR (Vartype(m.tuValue) = 'C' And Trim(m.tuValue) == '{}')
	Return .Null.
Else
	Return m.tuValue
Endif
I suggest totally forgetting about "empty" date/times and use nulls instead.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform