Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing a Field Type
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00945673
Message ID:
00945675
Views:
15
>I would like to pass a value from a temp file to SQL server field. The type of field could be a memo field or a date field. To get the value into SQL server it needs to a string. Therefore I need to test what the field type is first.
>
>Therefore I would like to find whether the field is a date or a memo based on this I will either DTOS the field or use a function for converting a memo field into a date field.
>
>IIF(planning.date=A MEMO FIELD TYPE, whatever function, DTOS(planning.date)
>
>I just need to find out what type of field it is then either convert the date to string or the memo to string. Is this possible?


Take a look in TYPE() or VARTYPE() function
?TYPE("Table1.MemoField") && Returns "C"
?TYPE("Table1.DateField") && Returns "D"

?VARTYPE(Table1.MemoField) && Returns "C"
?VARTYPE(Table1.DateField) && Returns "D"
so I do the following IIF()
IIF(TYPE("planning.date") == "D",DTOS(planning.date),  whatever function)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform