CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: help please!

  1. #1
    Join Date
    May 2003
    Location
    philippines
    Posts
    8

    Question help please!

    hello experts!

    i think this query works fine but the results returns a date that is NOT between January and March....

    is there something wrong with my query??

    Data1.RecordSource = "Select publisher, address, postalcode, tel, fax, isbn, publication, author, edition, l_used, b_used From isbn Where format([Date], ""yyyy"") = '" & year.Text & "' AND Format([Date], ""mmm"") between 'Jan' and 'Mar' order by publisher"

    Thankies!!

    Joy

  2. #2
    Join Date
    Apr 2002
    Location
    Haryana, India
    Posts
    198

    SQL Query Problem

    Hi kjcarrots,

    Please replace your query with following:

    Data1.RecordSource = "Select publisher, address, postalcode, tel, fax, isbn, publication, author, edition, l_used, b_used From isbn Where YEAR([Date]) = '" & year.Text & "' AND (MONTH([Date]) between 1 and 3) order by publisher"

    Hope this will solve your problem.
    Enjoy,

    Gurdarshan Singh
    L.S.E. (Project Lead)
    InterGlobe Technologies Pvt. Ltd.
    Mobile #: 9891397798 (India)
    gurdarhan.singh@interglobetechnologies.com
    gurdarshan70@hotmail.com

    Always Think Positive whatever may be the Situation.

    Please rate my suggestion/response if you find it suitable or fulfill your requirement.

  3. #3
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569
    for your purposes, better than the MONTH command is the MONTHNAME command.
    Mike

  4. #4
    Join Date
    May 2003
    Location
    philippines
    Posts
    8
    Thanks guys for the help!

    JOY

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

Featured