Results 1 to 3 of 3

Thread: SQL For vb 6 and the data environment

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I was wondering if anyone could help me with the syntax for the following query I need to perform:

    I have a field in my data base called DATE_OPENED.

    I need to make a sql statement that has the number of DATE_OPENED for the month or March.

    I have SELECT COUNT(*) AS MarchReceived FROM MASTER WHERE (DATE_OPENED <>'"')

    However, I need to get only the records from March that have something in the DATE_OPENED field. I'm thinking I need the between statement 3/1/00 and 3/31/00 but not sure how to use all of this in one statement or the correct syntax.

    Any help would be great!!!

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Posts
    308
    Hi, there.

    SELECT COUNT(*) AS MarchReceived FROM MASTER WHERE DATE_OPENED BETWEEN #3/1/00# AND #3/31/00#

    Larisa



  3. #3
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59
    Hi,
    You can try this way also.
    if you want to search for the month only then you can try this also.

    Select count(*) as name from table where field = month(now)

    this will return all rows for current month.

    If you want to search other than the current month use a combo box to select and use the index value for your search.

    thanks
    karun

Posting Permissions

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



Click Here to Expand Forum to Full Width