If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > Need help with an UPDATE QUERY

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-21-03, 12:27
DB.Fun DB.Fun is offline
Registered User
 
Join Date: Feb 2003
Posts: 1
Need help with an UPDATE QUERY

Version: Corel Paradox 8

Personal Background: I have a few years of experience programming on client-side applications and SQL DBs, however I am new to Corel Paradox and I need help.

Situation:

I am trying to enhance a script file that is part of an existing application. I need to update one table based upon data in another table. In particular, I need to update an Alpha field in a table with the string equivalent of a date field in another table. The goal is to have the date value stored as a string in YYYYMMDD format.

Below I have provided a snippet of the code. My quess is that format() is not accessible in a query.

Thank you in advance,
DB.Fun

Sample Code:

var
qry query
endvar

qry = query

Table1.db | T1Col1 | T1Col2 |
| _join1 | _T1Col2 |

Table2.db | T2Col1 | T2Col2 |
| _join1 | .., changeto format("DY3M2D2O(%y%m%d)", _T1Col2) |

endquery
executeqbe(qry)

Where:

Table: Table1.db
Field: T1Col1
Datatype: Alpha

Field: T1Col2
Datatype: Date

Table: Table2.db
Field: T2Col1
Datatype: Alpha

Field: T2Col2
Datatype: Alpha
Reply With Quote
  #2 (permalink)  
Old 08-27-03, 17:04
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
You can do it by two queries:

With the first one you translate the date to three alpha fields using the Year() Month() Day() functions, then use another query to bring them together in one string, or even do it in one pass...
__________________
The only failure is not trying to do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On