damixa
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
thanks in advance,
Vinnie
the code is
IIf(Nz([SumofAmount])+Nz([LegacyTotal])=0,Null,CCur(Nz([SumofAmount])+Nz([LegacyTotal]))) AS AllLegacyTotal
thanks in advance,
Vinnie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER