Microsoft
Software
Hardware
Network
Question : SQL- Find the diferrence, above or below target
I've got a sales target - say 7,500
How in sql can I tell if a figure is below or above that target.
eg
If the target was 7,500 and the TotalSales was 7,571.55 then I'd want to display in another column called UntilTarget -£71.55 (above Target)
If the targetwas 7,500 and the TotalSales was 7,428.45 then I'd want to display in another column called UntilTarget £71.55 (below Target)
How do I write this in SQL
Thanks
Answer : SQL- Find the diferrence, above or below target
Hello edjones1,
Assuming both are from the same table or view...
SELECT TargetSales, TotalSales, TargetSales - TotalSales AS Variance
FROM SomeTableOrView
Regards,
Patrick
Random Solutions
Closing of Internet Explorer at the end of a process in ms access 2003
W3WP crashing windows server 2003 and 2008 and iis6 and iis7
Unable to open <a rel="nofollow" href="http://" target="_blank">http://</a>.... Cannot download the information you requested
Stored Procedure Execution Options
DoCmd.RunApp ???
Make a relationship between two tables on one form.
Disable spam filtering on Exchange 2007
MAX value of a column
Outlook voting button no response summary
Combo Box Events