Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC Cursor Datetime type to Date
Message
From
25/10/2001 21:10:53
 
 
To
25/10/2001 18:09:16
Monte Murdock
Universal American Mortgage Company
Clearwater, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00573416
Message ID:
00573475
Views:
30
>>>>>Does anyone know how to turn a DateTime type field to a Date type field in a SQLEXEC cursor, not a remote view?
>>>>>
>>>>>TIA
>>>>>
>>>>>MOnTe
>>>>
>>>>Have you looked at TTOD() or TTOC()?
>>>
>>>I am changing the SQLEXEC cursor to allow updates. The date column in the cursor can be changed in a grid and you cannot update a calculated column (e.g. TTOD(closed_date)). Basically, I want to do to a SQLEXEC cursor what you can already do to a remote view like with the following command:
>>>DBSetProp('rvClosed.closed_date', 'Field', 'DataType', "D")
>>>
>>>Any other ideas?
>>
>>What's your backend database? If it's SQL Server you could use the CONVERT() function to return only the date portion in a character field. Then whenever you send the updates SQL Server will not complain about the type, as long as it's in a date format that it can understand. I think it's Convert(character(10), myField, 121) to get the date portion only on a character field.
>>
>>How are you planning to send the updates back?
>
>
>I'm using SQL Server. Also, I've tried the SQL Server CONVERT function, however, the date is not validated...I would have to write so sort of textbox date validator to check the date...that is what I was trying to get away from.

You could probably send individual updates manually too, validating in the BeforeRowColChange and sending the update on AfterRowColChange event.
Previous
Reply
Map
View

Click here to load this message in the networking platform