Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Do An IIF()...
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01115062
Message ID:
01115989
Vues:
10
Sergey,

This was working Ok, then I added the JOIN to Result_Detail_Info. I now get the error:
"Line 11: Incorrect syntax near '.'."

Here's the code:
SELECT rd.create_date,
       rd.transaction_date,
       0 as batchid,
       rd.telemrkt_company,
       tm.company_code,
       count(*) as Cnt,
       rdi.status,
       rdi.used_by,
       (CASE WHEN LEN(rdi.BatchNo)= 0 THEN '' ELSE rdi.Used_By END) AS rdi.Used_By
FROM result_detail rd
JOIN telemrkt_company tm on rd.telemrkt_company = tm.id
LEFT OUTER JOIN result_detail_info rdi on rd.id = rdi.result_detail_id
WHERE rdi.status IS NULL
GROUP BY rd.create_date, rd.transaction_date, rd.telemrkt_company, tm.company_code, rdi.status, rdi.used_by, rdi.process_batch
ORDER BY company_code
The error is on the line with the CASE. When I remove that line, it works fine.

I welcome your expert insight!
k



>There's incomplete list on http://fox.wikis.com
>>
>>Don't suppose you know where I can find a list of SQL functions compared
>>to VFP functions?
>>
>>
>>
>>>You can replace IIF() with CASE
>>>
>>>       (CASE WHEN LEN(BatchNo)= 0 THEN '' ELSE Used_By END) AS Used_By;
>>>
>>>>How can I do this field selection that uses VFP's IIF() in SQL?
>>>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform