Hi,
I've been trying to transfer the following statement in an Access query to a view in SQL and cannot figure out the best approach. I've investigated CASE but this fails whenever I use symbols like > but would be fine if I substituted in the CASE statement for a text entry. I'm sure its obvious to a more experienced programmer than I!
MS Access SQL Code
Switch([GSCore]>=7,"A",[GSCore]>=6.5,"A/B",[GSCore]>=6,"B/C",[GSCore]>=5.5,"C/D",[GSCore]>=5,"D",[GSCore]<5,"D/E",True,"N/A") AS TMG INTO tblTMG
SQL Server code that I could get to work
SELECT admission_no, SPoints, SUnits, GScore, CASE GScore WHEN '7' THEN GScore * 2 WHEN '6' THEN GScore * 50 ELSE GScore END AS TMG
FROM dbo.vw_EntryCalcs
Hope this is clear enough, if not I'll try to clarify.
Thanks
Simon
I've been trying to transfer the following statement in an Access query to a view in SQL and cannot figure out the best approach. I've investigated CASE but this fails whenever I use symbols like > but would be fine if I substituted in the CASE statement for a text entry. I'm sure its obvious to a more experienced programmer than I!
MS Access SQL Code
Switch([GSCore]>=7,"A",[GSCore]>=6.5,"A/B",[GSCore]>=6,"B/C",[GSCore]>=5.5,"C/D",[GSCore]>=5,"D",[GSCore]<5,"D/E",True,"N/A") AS TMG INTO tblTMG
SQL Server code that I could get to work
SELECT admission_no, SPoints, SUnits, GScore, CASE GScore WHEN '7' THEN GScore * 2 WHEN '6' THEN GScore * 50 ELSE GScore END AS TMG
FROM dbo.vw_EntryCalcs
Hope this is clear enough, if not I'll try to clarify.
Thanks
Simon