Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Counting Values from a Combo Box

    Hi all I know that I have done this before but for the life of me I cant remember how. I'm working in a database created by someone else, in MS Access 2010 and I'm trying to create a query where I can calculate values in a Comb Box.
    I know how to do this in SQL but I'm struggling with converting this to access
    Code:
    SELECT        People_tbl.[Parent ID], People_tbl.StudentLastName, People_tbl.StudentFirstName, TanfActivity_tbl.EventDate, TanfActivity_tbl.Earnedhours, 
                             TanfActivity_tbl.Catagoryforhours, TanfActivity_tbl.StateCatagory, TanfActivity_tbl.ServicesCovered, TanfActivity_tbl.StateServicesCovered, People_tbl.ReferralDate, 
                             People_tbl.ReferralStatus, People_tbl.TANF, People_tbl.Adult_Child, People_tbl.Weekly, People_tbl.Month
    FROM            People_tbl INNER JOIN
                             TanfActivity_tbl ON People_tbl.[Parent ID] = TanfActivity_tbl.[Parent ID]
    WHERE        (People_tbl.ReferralStatus = N'Active') AND (TanfActivity_tbl.EventDate BETWEEN @Beginning_EventDate AND @End_EventDate) AND (People_tbl.TANF = N'Yes') 
                             AND (People_tbl.Adult_Child = N'Adult') AND (TanfActivity_tbl.Earnedhours IS NOT NULL) AND (TanfActivity_tbl.Catagoryforhours IN (N'ITP', N'Parenting', 
                             N'Education', N'Culture', N'Job Skills Training', N'Life Skills', N'Travel'))
    ORDER BY CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'ITP' THEN 0 ELSE 1 END, CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Parenting' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Job Skills Training' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Culture' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Education' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Life Skills' THEN 0 ELSE 1 END, CASE WHEN TanfActivity_tbl.[Catagoryforhours
    Last edited by desireemm; 10-23-14 at 01:30.

  2. #2
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I have to change this Select Statement into a statement that Access can understand. Ugh

    Can anyone help pls

    Code:
    SELECT        People_tbl.[Parent ID], People_tbl.StudentLastName, People_tbl.StudentFirstName, TanfActivity_tbl.EventDate, TanfActivity_tbl.Earnedhours, 
                             TanfActivity_tbl.Catagoryforhours, TanfActivity_tbl.StateCatagory, TanfActivity_tbl.ServicesCovered, TanfActivity_tbl.StateServicesCovered, People_tbl.ReferralDate, 
                             People_tbl.ReferralStatus, People_tbl.TANF, People_tbl.Adult_Child, People_tbl.Weekly, People_tbl.Month
    FROM            People_tbl INNER JOIN
                             TanfActivity_tbl ON People_tbl.[Parent ID] = TanfActivity_tbl.[Parent ID]
    WHERE        (People_tbl.ReferralStatus = N'Active') AND (TanfActivity_tbl.EventDate BETWEEN @Beginning_EventDate AND @End_EventDate) AND (People_tbl.TANF = N'Yes') 
                             AND (People_tbl.Adult_Child = N'Adult') AND (TanfActivity_tbl.Earnedhours IS NOT NULL) AND (TanfActivity_tbl.Catagoryforhours IN (N'ITP', N'Parenting', 
                             N'Education', N'Culture', N'Job Skills Training', N'Life Skills', N'Travel'))
    ORDER BY CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'ITP' THEN 0 ELSE 1 END, CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Parenting' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Job Skills Training' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Culture' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Education' THEN 0 ELSE 1 END, 
                             CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Life Skills' THEN 0 ELSE 1 END, CASE WHEN TanfActivity_tbl.[Catagoryforhours] = N'Travel' THEN 0 ELSE 1 END,
                              People_tbl.StudentLastName, People_tbl.StudentFirstName
    Last edited by desireemm; 10-23-14 at 01:26.

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    nevermind I go 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
  •