Welcome to SPN

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

Sign Up Now!

Count Query

Discussion in 'Information Technology' started by Gale Coleman, Jul 28, 2006.

Tags:
  1. Gale Coleman

    Gale Coleman
    Expand Collapse
    Guest

    Hello all,

    I have a query that has expressions in it to convert check boxes to numbers.
    How would I write an expression in the query that would include pulling the
    information out of a field and listing it as text. All the other
    expressions are turning check marks into numbers or where statements, but I
    can't figure out how to just list what is in the field. The field that I
    want to pull the information out of is named other_specify.

    following is the current query that works, I just want to add something into
    it that pulls the text from the "other_specify" field.

    Any help is appreciated!!!
    Thanks,
    Gale


    SELECT Sum(IIf([sexual_assault_fully],1,0)) AS sexual_assault_full,
    Sum(IIf([sexual_assault_partial],1,0)) AS sexual_assault_par,
    Sum(IIf([sexual_assault_not],1,0)) AS sexual_assault_n,
    Sum(IIf([domestic_fully],1,0)) AS domestic_full,
    Sum(IIf([domestic_partial],1,0)) AS domestic_par,
    Sum(IIf([domestic_not],1,0)) AS domestic_n, Sum(IIf([stalking_fully],1,0))
    AS stalking_full, Sum(IIf([stalking_partial],1,0)) AS stalking_par,
    Sum(IIf([stalking_not],1,0)) AS stalking_n,
    Sum(IIf([program_r_capacity],1,0)) AS program_r_cap,
    Sum(IIf([need_not_documented],1,0)) AS need_not_doc,
    Sum(IIf([not_eligible],1,0)) AS not_elig, Sum(IIf([limited_resources],1,0))
    AS limited_ress, Sum(IIf([not_appropriate],1,0)) AS not_app,
    Sum(IIf([transportation],1,0)) AS transport, Sum(IIf([conflict],1,0)) AS
    conflic, Sum(IIf([abuse_problems],1,0)) AS abuse_probs,
    Sum(IIf([mental_health],1,0)) AS mental_hlth,
    Sum(IIf([male_adolescents],1,0)) AS male_adol,
    Sum(IIf([inadequate_language],1,0)) AS inadequate_lang,
    Sum(IIf([geographic],1,0)) AS geog, Sum(IIf([other],1,0)) AS othe,
    Count(zLAV.Casenum) AS CountOfCASENUM
    FROM CLIENTSW INNER JOIN zLAV ON CLIENTSW.CASENUM = zLAV.Casenum
    WHERE (((CLIENTSW.DOPEN) Between [Enter beginning date] And [Enter ending
    date]) AND ((CLIENTSW.FUNDSNUM)=12 Or (CLIENTSW.FUNDSNUM)=13));
     
  2. Loading...

    Similar Threads Forum Date
    Ashdoc's Movie Review---The Accountant Theatre, Movies & Cinema Oct 21, 2016
    Gurmat Vichaar | Futility Of Counting Paaths | April 12, 2016 Gurmat Vichaar Apr 23, 2016
    wolf count Blogs Oct 17, 2015
    recount Blogs Oct 17, 2015
    Events Banda Singh Bahadur's Martyrdom - An Eyewitness Account History of Sikhism Mar 26, 2015

  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Gale,

    you have the tough stuff... now for the easy one ;)

    SELECT Sum(IIf([sexual_assault_fully],1,0)) AS
    sexual_assault_full, etc, other_specify
    FROM ...
    WHERE ...


    Warm Regards,
    Crystal
    MVP Microsoft Access

    remote programming and training
    strive4peace2006 at yahoo.com
    *
    Have an awesome day ;)


    Gale Coleman wrote:
    > Hello all,
    >
    > I have a query that has expressions in it to convert check boxes to numbers.
    > How would I write an expression in the query that would include pulling the
    > information out of a field and listing it as text. All the other
    > expressions are turning check marks into numbers or where statements, but I
    > can't figure out how to just list what is in the field. The field that I
    > want to pull the information out of is named other_specify.
    >
    > following is the current query that works, I just want to add something into
    > it that pulls the text from the "other_specify" field.
    >
    > Any help is appreciated!!!
    > Thanks,
    > Gale
    >
    >
    > SELECT Sum(IIf([sexual_assault_fully],1,0)) AS sexual_assault_full,
    > Sum(IIf([sexual_assault_partial],1,0)) AS sexual_assault_par,
    > Sum(IIf([sexual_assault_not],1,0)) AS sexual_assault_n,
    > Sum(IIf([domestic_fully],1,0)) AS domestic_full,
    > Sum(IIf([domestic_partial],1,0)) AS domestic_par,
    > Sum(IIf([domestic_not],1,0)) AS domestic_n, Sum(IIf([stalking_fully],1,0))
    > AS stalking_full, Sum(IIf([stalking_partial],1,0)) AS stalking_par,
    > Sum(IIf([stalking_not],1,0)) AS stalking_n,
    > Sum(IIf([program_r_capacity],1,0)) AS program_r_cap,
    > Sum(IIf([need_not_documented],1,0)) AS need_not_doc,
    > Sum(IIf([not_eligible],1,0)) AS not_elig, Sum(IIf([limited_resources],1,0))
    > AS limited_ress, Sum(IIf([not_appropriate],1,0)) AS not_app,
    > Sum(IIf([transportation],1,0)) AS transport, Sum(IIf([conflict],1,0)) AS
    > conflic, Sum(IIf([abuse_problems],1,0)) AS abuse_probs,
    > Sum(IIf([mental_health],1,0)) AS mental_hlth,
    > Sum(IIf([male_adolescents],1,0)) AS male_adol,
    > Sum(IIf([inadequate_language],1,0)) AS inadequate_lang,
    > Sum(IIf([geographic],1,0)) AS geog, Sum(IIf([other],1,0)) AS othe,
    > Count(zLAV.Casenum) AS CountOfCASENUM
    > FROM CLIENTSW INNER JOIN zLAV ON CLIENTSW.CASENUM = zLAV.Casenum
    > WHERE (((CLIENTSW.DOPEN) Between [Enter beginning date] And [Enter ending
    > date]) AND ((CLIENTSW.FUNDSNUM)=12 Or (CLIENTSW.FUNDSNUM)=13));
    >
    >
    >
    >
     
  4. Gale Coleman

    Gale Coleman
    Expand Collapse
    Guest

    Thanks,

    Gale
     
  5. strive4peace

    strive4peace
    Expand Collapse
    Guest

    you're welcome, Gale ;) happy to help

    Warm Regards,
    Crystal
    MVP Microsoft Access

    remote programming and training
    strive4peace2006 at yahoo.com
    *
    Have an awesome day ;)


    Gale Coleman wrote:
    > Thanks,
    >
    > Gale
    >
    >
     

Share This Page