Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing a String in SPT Statement
Message
 
À
11/05/2005 17:25:10
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01013173
Message ID:
01013177
Vues:
12
>I am tring to get a record set out of an AS400 database using SPT. I need to filter on a field that holds a job number.
>
>My trouble is the AS400 field was set up to use a "-"(Dash) in the string. I automaticatlly gets inserted into the fourh place of the string. Example:
>MES-5350. This is a carry-over from a former type of job number. Our job numbers today don't have dashes in them but the AS400 database hasn't been nor probably won't be changed. So when the job number is entered and someone mistakingly adds a dash the jobnumber can look like this MES--5350.
>
>My desire is to query the record for a specific job number with SPT stripping out any dashes to do my comparison.
>
>This will not work s I need some help:
>dwgListString = "Select dm_drawing_number, dm_files3 From drawmstrp Where StrTran(drawmstrp.dm_job_order,'-','') = '" + jobnumber + "'"

I am not a very familiar with AS400 but in t-SQL there is a REPLACE() function, Is there such a function in AS400?
something like:
dwgListString = "Select dm_drawing_number, dm_files3 From drawmstrp Where REPLACE(drawmstrp.dm_job_order,'-','') = '" + jobnumber + "'"
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform