Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2004
    Posts
    11

    Question Unanswered: which field shld i use?

    hi guys i have another problem , hope u can give me some pointers.
    below is the project i am doing to give it a clearer overview

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    My needed project

    A very simple food menu tracking form and statistics form

    1) a client-side ASP form page (for waiters) that has e.g 4 checkbox available for them to choose

    > pasta
    > coke
    > pizza
    > sides

    - they can select 1-4 checkbox and when submit, they will be submitting to a DB

    next

    2) a server side ASP form to display the selection trend as inserted abv (sort of a statistics page) and retrieve info from the DB

    - the stats that i need in that page

    1) how many orders for that day (!!! problem here)
    2) food selection

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    my problem right now is how to determine which field for the "how many orders for that day"

    as my db field is only ( date, selection,waiter name, waiter ID)

    hope u guys can give me some pointers
    appreciated =)

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have a look at the followign sub clauases in the SELECT statement

    SUM(<mycolumn#1>)
    AND
    GROUP BY <mycolumn#2>;
    usage is
    SELECT <mycolumn#1>,SUM(<mycolumn#2>) FROM <mytable> GROUP BY <mycolumn#1>;
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    might want to consider the COUNT() aggregate function for the "how many orders per day" question
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by r937
    might want to consider the COUNT() aggregate function for the "how many orders per day" question
    ..good point, but I did think silverxc had to do something to get the answer they are looking for
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Dec 2004
    Posts
    11

    which field.??

    hi guys i think my qn might not be phrased very correctly

    wat i need to find out is @ my statistics page , i need to display the no. of orders for a particular day , but however now my tracking is only based on

    as my db field is only ( date, selection,waiter name, waiter ID)

    and this insert statement can happen 2-3 times but for only one order

    1) ONE ORDER but with 2 items
    20/11/06 pasta steven 4077
    20/11/06 calamari steven 4077

    so i need to think of a field to collate the orders. and this is the headache i am facing, hope u guys can give me some pointers.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what have you tried so far, and what about your attempt that isnt working?
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Dec 2004
    Posts
    11
    Quote Originally Posted by healdem
    so what have you tried so far, and what about your attempt that isnt working?

    yup thats the thing.. i cant figure out which field shld i add on to track the orders.

    things i am pondering right now is shld i open another table just to track the field?

  8. #8
    Join Date
    Dec 2004
    Posts
    11
    hi guys i have thgt of an idea but suspect its not very effective in some ways.


    wat i can think of is to create another table just to store the orders.
    this can solve my problems right now but is there any better ideas u can advise me?

    thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •