• Needing Help with Simple IIF Statement

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Needing Help with Simple IIF Statement

    Author
    Topic
    #473452

    I need to add a column to my query that finds all the 1’s and then counts the number of 1’s and puts that result into the new column with the Header titled Jan.

    I’ve been searching all thought the web looking for some sort of IIF statement that might do what I’m asking, but having now luck. Any advice or help would be very much appreciated.

    If field1 has a 1 in move it to the new column header jan, if field1 has a 2 in it, mover it to a new column header Fed and so forth.

    If this helps, once I have all the new fields, I’ll need to count each on in a summary query

    Once again any advice or help would be very much appreciated.

    Viewing 4 reply threads
    Author
    Replies
    • #1257796

      Hi!

      have you considered a Crosstab query?

      Regards,

      Jules

    • #1257797

      I presume you are working with Access – if that’s the case you can best do that on a report, not in a query. You can put a group heading into a report and include the count of records for each Month. You can use a GroupBy query to also do that sort of thing, but it will only show you the summary numbers, and not the detail records.

    • #1257799

      How do you do a groupby query?

      • #1257811

        How do you do a groupby query?

        It depends on the version of Access you are working with – John has given you the answer for 2007/2010 – in earlier versions there is a Totals button available on the design toolbar, or as a command on the Menu.

    • #1257809

      To create a Totals or GroupBy query you click the Totals button on the Query Design tab of the ribbon. (So you must be in the design view of a query to do this.)

      You can read more about them here

      A crosstab query is a further step again. Crosstab is shown on the same ribbon tab.

      You can read about crosstabs here

    • #1257927

      The Crosstab query worked great. thanks for the advice

    Viewing 4 reply threads
    Reply To: Needing Help with Simple IIF Statement

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: