M
Mel
Can anyone PLEASE assist me with my SQL Select query? I have a table
that keeps track of user login information so there will be many
records for a given user. I have 5 boolean fields which are displayed
as check boxes (reference library, quotes, tracking, training,
calculators). How do I display the total of these boolean fields for
a given user (I only want the boxes that are checked)? When I run the
query I don't want to show each of the user's logins, I want it to
group the particular user's login data and just show one record which
contains the totals for the boolean fields. Any help would be greatly
appreciated.
Here is the query I have now:
SELECT Company, User, [Reference Library], Quotes, Tracking, Training,
[Calculators
FROM [Web User Log]
WHERE (((Company)="ABC, LLC") AND ((User)="jdoe"))
ORDER BY Company, User;
Here is the results of my query now:
Company User Reference Library Quotes Tracking Training Calculators
ABC, LLC jdoe No No No No No
ABC, LLC jdoe No No No No Yes
ABC, LLC jdoe No No Yes No No
ABC, LLC jdoe Yes Yes No Yes Yes
What I really want is this (just count the "Yes" records for that
user). How do I do it?:
Company User Reference Library Quotes Tracking Training Calculators
ABC, LLC jdoe 1 1 1 1 2
that keeps track of user login information so there will be many
records for a given user. I have 5 boolean fields which are displayed
as check boxes (reference library, quotes, tracking, training,
calculators). How do I display the total of these boolean fields for
a given user (I only want the boxes that are checked)? When I run the
query I don't want to show each of the user's logins, I want it to
group the particular user's login data and just show one record which
contains the totals for the boolean fields. Any help would be greatly
appreciated.
Here is the query I have now:
SELECT Company, User, [Reference Library], Quotes, Tracking, Training,
[Calculators
FROM [Web User Log]
WHERE (((Company)="ABC, LLC") AND ((User)="jdoe"))
ORDER BY Company, User;
Here is the results of my query now:
Company User Reference Library Quotes Tracking Training Calculators
ABC, LLC jdoe No No No No No
ABC, LLC jdoe No No No No Yes
ABC, LLC jdoe No No Yes No No
ABC, LLC jdoe Yes Yes No Yes Yes
What I really want is this (just count the "Yes" records for that
user). How do I do it?:
Company User Reference Library Quotes Tracking Training Calculators
ABC, LLC jdoe 1 1 1 1 2