I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

April Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCorel Paradox / ObjectPAL Coding BoardParadox Setup, Vista, etc. Topic   Print This     

paradox date fields...

paradox date fields... in Paradox Setup, Vista, etc. topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: paradox   paradox date   paradox date fields  
Johnc
 (Inactive)
cheektowaga
I use this code to update my paradox dbs canceled and inspected date fields
(SQL = "Update New_Order2 set InspectedDate = {" & Request.Form("isd" & intR) & "}, " & _
"CanceledDate = {" & Request.Form("cd" & intR) & "} where " & _
"FileNumber = '" & Request.Form("ref" & intR) & "' ")
it updates correctly to the database, however, if someone goes back to update that file again, the dates change from 2001 to 1901...does anyone know why when I update a file more than once it changes the date format from say 1/1/2001 to 1/1/1901?
thank you Big Grin!
 Posted 20 years ago (Thread Starter)
Comment Quote
About Johnc -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3150, 4 replies
Thread Started 8/1/2001 8:59:00 AM
View Counter=2279
Last Reply Posted 8/7/2001 10:21:00 AM)
Location=cheektowaga  
Joined=20 years ago   MB Posts=25  
Rick Carter
Cincinnati OH USA
You don't post enough of your code for us to know what the variables mean, and you don't tell us what version of Paradox and BDE. But, in short, you may have better luck if you cast your date as a string that includes the four-digit year, and pass that string to the SQL.
Rick Carter
Chair, Delphi/Paradox SIG
Cincinnati PC Users Group
 Posted 20 years ago
Comment Quote
About Rick Carter -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3189 (Level 1.1)  Reply to 3150
Thread Started 8/2/2001 7:08:00 AM
View Counter=2
Location=Cincinnati OH USA  
Joined=20 years ago   MB Posts=518  
Rick Carter
Cincinnati OH USA
Johnc, I don't see anything there except two blue lines with white space between them.

Once again, the code you have shown me doesn't look like any ObjectPAL code I've seen or written. Are you using Paradox for Windows? If so, which version? Are you passing your SQL to the Borland Database Engine? If so, which version?
Rick Carter
Chair, Delphi/Paradox SIG
Cincinnati PC Users Group
 Posted 20 years ago
Comment Quote
About Rick Carter -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3219 (Level 1.2)  Reply to 3150
Reply Posted 8/3/2001 11:18:00 AM
Location=Cincinnati OH USA  
Joined=20 years ago   MB Posts=518  
Johnc
 (Inactive)
cheektowaga
<%
today = Date()
stoday = Month(today) & "/" & Day(today) & "/" & Year(today)

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("APP")

Function ChkString(string)
'If String = "'" Then string = "''"
ChkString = Replace(string, "'", "''")
End Function

' loop each record
For intR = 0 to Request.Form("maxr")

' if reference field in record is defined, execute the following
If Len(Request.Form("ref" & intR)) > 0 then

' update order table relating to that order record
SQL = "Update New_Order set InspectedDate = {" & Request.Form("isd" & intR) & "}, " & _
"CanceledDate = {" & Request.Form("cd" & intR) & "} where " & _
"FileNumber = '" & Request.Form("ref" & intR) & "' "

'Response.write(SQL)
oConn.Execute(SQL)

if Err.Number > 0 then
Response.write("Error Updating New_Order with Filenumber: " & Request.Form("ref" & intR) & "

")
end if

' for 1 to max if comments exist
For intsc = 0 to Request.Form("sc_max" & intR)

' if the comments ref exist
If Len(Request.Form("sc" & intR & "_" & intsc)) > 0 then



' Main program don't mess with it

if Request.Form("exec_type" & intR & "_" & intsc) = "Update" then

' update an already existing comment of that record
SQL = "Update New_Ordrstat set " &_
"StatusComment = '" & ChkString(Request.Form("sc" & intR & "_" & intsc)) & "' " & _
"where FileNumber = '" & Request.Form("ref" & intR) & "' and StatusDate = {" & Request.Form("sd" & intR & "_" & intsc) & "} "
oConn.Execute(SQL)
'Response.write("Error: " & Err.Number & "
")
if Err.Number > 0 then
Response.write("Error Updating New_Ordrstat with FileNumber: " & Request.Form("ref" & intR) & "

")
end if
else

' add comments to ordstat table
SQL = "Insert into New_Ordrstat (FileNumber,StatusDate,StatusComment) values (" & _
"'" & Request.Form("ref" & intR) & "', " & _
"{" & Request.Form("sd" & intR & "_" & intsc) & "}, " & _
"'" & ChkString(Request.Form("sc" & intR & "_" & intsc)) & "') "

'Response.write(SQL)
oConn.Execute(SQL)

if Err.Number > 0 then
Response.write("Error Inserting New_Ordrstat with FileNumber: " & Request.Form("ref" & intR) & "

")
end if

end if

' End of main program


end if 'end If Len(Request.Form("sc" & intR & "_" & intsc)) > 0

Next 'end For intsc = 0 to Request.Form("sc_max")

end if 'end if Len(Request.Form("ref" & intR)) > 0

Next 'end For intR = 0 to Request.Form("maxr")


oConn.Close

%>
 Posted 20 years ago (Thread Starter)
Comment Quote
About Johnc -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3192 (Level 1.3)  Reply to 3150
Reply Posted 8/2/2001 7:28:00 AM
Location=cheektowaga  
Joined=20 years ago   MB Posts=25  
Most Recent Post
Johnc
 (Inactive)
cheektowaga
today = Date()
stoday = Month(today) & "/" & Day(today) & "/" & Year(today)

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("APP")
Function ChkString(string)
'If String = "'" Then string = "''"
ChkString = Replace(string, "'", "''")
End Function
' loop each record
For intR = 0 to Request.Form("maxr")
' if reference field in record is defind, execute the following
If Len(Request.Form("ref" & intR)) > 0 then


' update order table relating to that order record
SQL = "Update New_Order set InspectedDate = {" & Request.Form("isd" & intR) & "}, " & _
"CanceledDate = {" & Request.Form("cd" & intR) & "} where " & _
"FileNumber = '" & Request.Form("ref" & intR) & "' "

'Response.write(SQL)
oConn.Execute(SQL)

if Err.Number > 0 then
Response.write("Error Updating New_Order with Filenumber: " & Request.Form("ref" & intR) & "

")
end if

' for 1 to max if comments exist
For intsc = 0 to Request.Form("sc_max" & intR)

' if the comments ref exist
If Len(Request.Form("sc" & intR & "_" & intsc)) > 0 then



' Main program don't mess with it

if Request.Form("exec_type" & intR & "_" & intsc) = "Update" then

' update an already existing comment of that record
SQL = "Update New_Ordrstat set " &_
"StatusComment = '" & ChkString(Request.Form("sc" & intR & "_" & intsc)) & "' " & _
"where FileNumber = '" & Request.Form("ref" & intR) & "' and StatusDate = {" & Request.Form("sd" & intR & "_" & intsc) & "} "
oConn.Execute(SQL)
Response.write("Error: " & Err.Number & "
")
if Err.Number > 0 then
Response.write("Error Updating OrderStat with FileNumber: " & Request.Form("ref" & intR) & "

")
end if

else
' add comments to ordstat table
SQL = "Insert into New_Ordrstat (FileNumber,StatusDate,StatusComment) values (" & _
"'" & Request.Form("ref" & intR) & "', " & _
"{" & Request.Form("sd" & intR & "_" & intsc) & "}, " & _
"'" & ChkString(Request.Form("sc" & intR & "_" & intsc)) & "') "

'Response.write(SQL)
oConn.Execute(SQL)

if Err.Number > 0 then
Response.write("Error Inserting New_Ordrstat with FileNumber: " & Request.Form("ref" & intR) & "

")
end if

end if

' End of main program


end if 'end If Len(Request.Form("sc" & intR & "_" & intsc)) > 0

Next 'end For intsc = 0 to Request.Form("sc_max")

end if 'end if Len(Request.Form("ref" & intR)) > 0

Next 'end For intR = 0 to Request.Form("maxr")


oConn.Close
 Posted 20 years ago (Thread Starter)
Comment Quote
About Johnc -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3266 (Level 1.4)  Reply to 3150
Reply Posted 8/7/2001 10:21:00 AM
Location=cheektowaga  
Joined=20 years ago   MB Posts=25  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1181A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #3150 Counter
2279
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech