Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Update record
Message
From
16/10/2001 22:44:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL Update record
Miscellaneous
Thread ID:
00569376
Message ID:
00569376
Views:
46
Hi guys,

How do you code an sql update and execute it via SQL Passthrough or ADO. Im having problems in particular with date fields on how to insert Null to the date field if the value is empty . The code is shown below. When executing this code, it does not prompt for an error but it does not update the table.

If Empty(Entrydate)
cEntrydate = .NULL.
Else
cEntrydate = Ttod(Entrydate)
Endif

cSQL = [UPDATE bbfs!callinv SET callername = "]+ ALLTRIM(.callername) +[",] +;
[callerlocation = "]+ ALLTRIM(.callerlocation) +[",] +;
[entrydate = ] + "cEntrydate " +; [WHERE callrefno = ] + Alltrim(Str(cCallrefno))

This.oConn.Execute(cSQL)
Music Rocks www.musicreserve.blogspot.com
Success is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.
Next
Reply
Map
View

Click here to load this message in the networking platform