Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Untangle a mess

Discussion in 'Information Technology' started by Jeff C, Nov 4, 2005.

Tags:
  1. Jeff C

    Jeff C
    Expand Collapse
    Guest

    I have looked until cross-eyed at this and cannot find the problem:

    iif([tbl_NewPayroll]![Code1]=â€01â€,[tbl_New_Payroll]![Hours1],iif([tbl_NewPayroll]![Code2]=â€01â€,[tbl_New_Payroll]![Hours2],iif([tbl_NewPayroll]![Code3]=â€01â€,[tbl_New_Payroll]![Hours3],iif([tbl_NewPayroll]![Code4]=â€01â€,[tbl_New_Payroll]![Hours4],iif([tbl_NewPayroll]![Code5]=â€01â€,[tbl_New_Payroll]![Hours5],iif([tbl_NewPayroll]![Code6]=â€01â€,[tbl_New_Payroll]![Hours6],iif([tbl_NewPayroll]![Code7]=â€01â€,[tbl_New_Payroll]![Hours7],iif([tbl_NewPayroll]![Code8]=â€01â€,[tbl_New_Payroll]![Hours8],iif([tbl_NewPayroll]![Code9]=â€01â€,[tbl_New_Payroll]![Hours9],[tbl_NewPayroll]![Code10]=â€01â€,[tbl_New_Payroll]![Hours10])))))))))

    I also tried this with no luck:

    Switch([tbl_NewPayroll]![Code1]="â€01â€",[tbl_New_Payroll]![Hours1],[tbl_NewPayroll]![Code2]="â€01â€",[tbl_New_Payroll]![Hours2],[tbl_NewPayroll]![Code3]="â€01â€",[tbl_New_Payroll]![Hours3],[tbl_NewPayroll]![Code4]="â€01â€",[tbl_New_Payroll]![Hours4],[tbl_NewPayroll]![Code6]="â€01â€",[tbl_New_Payroll]![Hours6],[tbl_NewPayroll]![Code7]="â€01â€",[tbl_New_Payroll]![Hours7],[tbl_NewPayroll]![Code8]="â€01â€",[tbl_New_Payroll]![Hours8],[tbl_NewPayroll]![Code9]="â€01â€",[tbl_New_Payroll]![Hours9],[tbl_NewPayroll]![Code10]="â€01â€",[tbl_New_Payroll]![Hours10])

    I am using this in an update query, the second attempt gets me a parameter
    message looking for the "True" field. Anyone have an idea? Thank you
     
  2. Loading...

    Similar Threads Forum Date
    Sikhi Unsung Heroes - Gurmeet Singh, A Messiah For The Abandoned Sick Sikh Sikhi Sikhism Feb 15, 2016
    How message of love from Sikh gurus are helping Pakistani Christians to fight forced conversions Sikh Sikhi Sikhism Oct 12, 2015
    Messages from God Sikh Sikhi Sikhism Aug 23, 2015
    Messenger Of Death Gurmat Vichaar Project Feb 20, 2015
    Message of Guru Granth Sahib Essays on Sikhism Jan 30, 2014

  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    My suggestion: Use a Select Case Statement or a loop rather then this many
    nested IIf's. But looking at your first mess of IIf statements, you don't
    have an IIf for Code10="01" and a final statement of what happens if it is
    none of these--I added a 0 for this and another paranthesis:

    iif([tbl_NewPayroll]![Code1]=â€01â€,[tbl_New_Payroll]![Hours1],iif
    ([tbl_NewPayroll]![Code2]=â€01â€,[tbl_New_Payroll]![Hours2],iif
    ([tbl_NewPayroll]![Code3]=â€01â€,[tbl_New_Payroll]![Hours3],iif
    ([tbl_NewPayroll]![Code4]=â€01â€,[tbl_New_Payroll]![Hours4],iif
    ([tbl_NewPayroll]![Code5]=â€01â€,[tbl_New_Payroll]![Hours5],iif
    ([tbl_NewPayroll]![Code6]=â€01â€,[tbl_New_Payroll]![Hours6],iif
    ([tbl_NewPayroll]![Code7]=â€01â€,[tbl_New_Payroll]![Hours7],iif
    ([tbl_NewPayroll]![Code8]=â€01â€,[tbl_New_Payroll]![Hours8],iif
    ([tbl_NewPayroll]![Code9]=â€01â€,[tbl_New_Payroll]![Hours9],iif
    ([tbl_NewPayroll]![Code10]=â€01â€,[tbl_New_Payroll]![Hours10],0))))))))))


    "Jeff C" wrote:

    > I have looked until cross-eyed at this and cannot find the problem:
    >
    > iif([tbl_NewPayroll]![Code1]=â€01â€,[tbl_New_Payroll]![Hours1],iif([tbl_NewPayroll]![Code2]=â€01â€,[tbl_New_Payroll]![Hours2],iif([tbl_NewPayroll]![Code3]=â€01â€,[tbl_New_Payroll]![Hours3],iif([tbl_NewPayroll]![Code4]=â€01â€,[tbl_New_Payroll]![Hours4],iif([tbl_NewPayroll]![Code5]=â€01â€,[tbl_New_Payroll]![Hours5],iif([tbl_NewPayroll]![Code6]=â€01â€,[tbl_New_Payroll]![Hours6],iif([tbl_NewPayroll]![Code7]=â€01â€,[tbl_New_Payroll]![Hours7],iif([tbl_NewPayroll]![Code8]=â€01â€,[tbl_New_Payroll]![Hours8],iif([tbl_NewPayroll]![Code9]=â€01â€,[tbl_New_Payroll]![Hours9],[tbl_NewPayroll]![Code10]=â€01â€,[tbl_New_Payroll]![Hours10])))))))))
    >
    > I also tried this with no luck:
    >
    > Switch([tbl_NewPayroll]![Code1]="â€01â€",[tbl_New_Payroll]![Hours1],[tbl_NewPayroll]![Code2]="â€01â€",[tbl_New_Payroll]![Hours2],[tbl_NewPayroll]![Code3]="â€01â€",[tbl_New_Payroll]![Hours3],[tbl_NewPayroll]![Code4]="â€01â€",[tbl_New_Payroll]![Hours4],[tbl_NewPayroll]![Code6]="â€01â€",[tbl_New_Payroll]![Hours6],[tbl_NewPayroll]![Code7]="â€01â€",[tbl_New_Payroll]![Hours7],[tbl_NewPayroll]![Code8]="â€01â€",[tbl_New_Payroll]![Hours8],[tbl_NewPayroll]![Code9]="â€01â€",[tbl_New_Payroll]![Hours9],[tbl_NewPayroll]![Code10]="â€01â€",[tbl_New_Payroll]![Hours10])
    >
    > I am using this in an update query, the second attempt gets me a parameter
    > message looking for the "True" field. Anyone have an idea? Thank you
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page