Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert one Access SQL query to VFoxPro5 query ?
Message
From
17/09/2003 13:32:35
 
 
To
17/09/2003 13:06:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00829942
Message ID:
00829984
Views:
22
>> I just don`t understand what exactly means: ((Customers.id) Like "######?###?"))
>
>#=number
>?=any character
>
>That's sosial security number format, ddmmyyXzzzP where non-obvious are:
>X= - for 1900 century, and A for after 2000
>zzz=number
>P=number or character
>
>The purpose is to import those customer records that have correct social security number, because for some customers that number is not available and there is glibberish instead. There is table field where it's usually marked M=male and N=female, but sometimes it's not entered at all (forgot etc) or it is incorrect.
>
>>And, You gave the condition: WHERE (((Customers.id) Is Null).. If is only
>> for nulls.. For what reason are we taken the position 10,1 of some
>> substring to see if is male or famale?
>
>That's according to formula how you can calculate from sosial security number is person male or female.

There is no such thing in VFP for mixed fields (alpha and numbers).. To test, if the value is numeric or not, we have isalpha() and isdigit() that give us if the first charact. of some string is number or is alpha..

The alterantive for you can be:
 val(substr(Customers.id,1,6))>0 .and. val(substr(Customers.id,8,2)) > 0 .and. isalpha(substr(Customers.id,7,1)) .and. isalpha(substr(Customers.id,11,1))
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform