Thread: SQL WHERE expressions visible
03-13-12, 10:56 #1Registered User
- Join Date
- Jun 2010
Unanswered: SQL WHERE expressions visible
I'm transferring an excel spreadsheet into a simple access database......I need to make calculations on table entries.
I want all the calculations done in queries.
I entered this excel IF statement to an SQL expression using WHERE instead of IF and [INVAMT] as field K3
(It calculates a charge based on the invoice amount, so K3 = $51, then $0.00; K3 = $201 then $2.00)
=IF(K3<50,0,IF(K3<201,2,IF(K3<601,4,IF(K3<1001,6,I F(K3<2501,15,IF(K3<5001,30,IF(K3<10001,60,IF(K3<25 001,90,120))))))))
So I named it OC:, with the show box unchecked
How do I enter it again as a visible column?
03-16-12, 06:21 #2(Making Your Life Easy)
Provided Answers: 10
- Join Date
- Feb 2004
- New Zealand
Msaccess can under stand if(c,t,f) sort of
But it's iif(c,t,f)
Think of Columns as feild name
Eg if column A=surname
In the database column is the feild name
By the way all this can be done in queryhope this help
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
THEY'RE BEHIND YOU FOR A REASON