![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have an existing view that is working. The problem is that I need to add one more piece of information to the view and I don't know how to accomplish this with Pervasive. The existing view is: SELECT DISTINCT "T2" ."ORDNUM_27" ,"T2" ."STATUS_27" ,"T2" ."CUSTPO_27" ,"T2" ."SHPVIA_27" ,"T2" ."NAME_27" ,"T2" ."ADDR1_27" ,"T2" ."ADDR2_27" ,"T2" ."CITY_27" ,"T2" ."STATE_27" ,"T2" ."ZIPCD_27" ,"T2" ."CNTRY_27" ,"T2" ."PHONE_27" ,"T2" ."CNTCT_27 " ,"T1" ."EMAIL1_81" ,"T1" ."EMAIL2_81" ,("T1" ."EMAIL1_81" +"T1" ."EMAIL2_81" )"EMAIL" FROM "Customer VAT" "T1" ,"SO Master" "T2" WHERE "T1" ."CUSTID_81" = "T2" ."CUSTID_27" AND "T2" ."STATUS_27" = '3' I need to add a return of 'Y' if there is an email address and the return of 'N' if there is not. Here's how it works using Access: EMAILFLAG1: IIf([emailaddress] Like '*@*',1) ----->Where [emailaddress] = the column name and using MS SQL: CASE WHEN emailaddress like `%@%' THEN `Y' else `N ` END AS EMAILflag FROM orders GO Can anyone tell me how it should look for Pervasive? Thanks for anything, Jag |
#3
| |||
| |||
|
|
Try this: include emailaddress in the select, then: CASE WHEN emailaddress LIKE '%@%' THEN 'Y' ELSE 'N' END as 'EmailFlag' FROM orders; Wayne Freeman www.analyticabiz.com Analytica Business Systems, Inc. A Premier Pervasive Partner To subscribe to our Pervasive news feed: www.analyticabiz.com/rss20.php jag wrote: I have an existing view that is working. The problem is that I need to add one more piece of information to the view and I don't know how to accomplish this with Pervasive. The existing view is: SELECT DISTINCT "T2" ."ORDNUM_27" ,"T2" ."STATUS_27" ,"T2" ."CUSTPO_27" ,"T2" ."SHPVIA_27" ,"T2" ."NAME_27" ,"T2" ."ADDR1_27" ,"T2" ."ADDR2_27" ,"T2" ."CITY_27" ,"T2" ."STATE_27" ,"T2" ."ZIPCD_27" ,"T2" ."CNTRY_27" ,"T2" ."PHONE_27" ,"T2" ."CNTCT_27 " ,"T1" ."EMAIL1_81" ,"T1" ."EMAIL2_81" ,("T1" ."EMAIL1_81" +"T1" ."EMAIL2_81" )"EMAIL" FROM "Customer VAT" "T1" ,"SO Master" "T2" WHERE "T1" ."CUSTID_81" = "T2" ."CUSTID_27" AND "T2" ."STATUS_27" = '3' I need to add a return of 'Y' if there is an email address and the return of 'N' if there is not. Here's how it works using Access: EMAILFLAG1: IIf([emailaddress] Like '*@*',1) ----->Where [emailaddress] = the column name and using MS SQL: CASE WHEN emailaddress like `%@%' THEN `Y' else `N ` END AS EMAILflag FROM orders GO Can anyone tell me how it should look for Pervasive? Thanks for anything, Jag |
![]() |
| Thread Tools | |
| Display Modes | |
| |