Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    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?

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    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

    Eg

    Excel if(A1="","missing",A1)
    Msaccess iif([surname]="","missing",[surname])

    By the way all this can be done in query
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •