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
Fox 9 Microsoft Visual Fox Pro Support Library Error
Putting a variable into SQL
Form goes corrupt after changes.
How do I auto-forward an email to an outside address and leave a copy on my system?
Outlook 2007 opens with choose profile
ListBox Selected Index from Javascript
passing string to container from Active-X
Cannot get calendar to start week on Sunday
Hi my website has a verisign certificate and it has secure payment integrated the certitifcate is expiring tomm. will i have any problem ?
run-time error '-247352567 (80020009)': You can't assign a value to this object