Link to home
Start Free TrialLog in
Avatar of damixa
damixaFlag for Denmark

asked on

convert small query from access to SQL Server

Sorry for the simple question, but i have a small query that is in access and I need to convert it so that it works in SQL server

the code is
IIf(Nz([SumofAmount])+Nz([LegacyTotal])=0,Null,CCur(Nz([SumofAmount])+Nz([LegacyTotal]))) AS AllLegacyTotal

Open in new window


thanks in advance,
Vinnie
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of damixa

ASKER

thanks
Thanks for the grade.  Good luck with your project.  -Jim
I've seen 2 questions like this now...

IIF translates to a "case expression"
Nz translates to ISNULL() or COALESCE() (the later accepts more parameters than isnull )
CCur translates to CAST() or CONVERT() using the 'money' as type


CASE (Transact-SQL)
CAST and CONVERT (Transact-SQL)
COALESCE (Transact-SQL)


IIF ( boolean_expression, true_value, false_value )
is available in SQL 2012
see: http://technet.microsoft.com/en-us/library/hh213574.aspx