Results 1 to 3 of 3

Thread: Date issue

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    3

    Date issue

    I am feeling really stupid right now. I have data with ARCAll = 1/27/2010, 1/28/2010, 1/2/2010 and 1/29/2010.

    I have the following query which retrieves no records:

    SELECT fqry_ARCall_list.ARCallID, fqry_ARCall_list.ARCallDate, fqry_ARCall_list.ARCallTypeID, fqry_ARCall_list.BillCompany, fqry_ARCall_list.ARCallPerson, fqry_ARCall_list.ARCallNote
    FROM fqry_ARCall_list
    WHERE (((fqry_ARCall_list.ARCallDate)>=Format(1/2/2010,"mm/dd/yyyy") And (fqry_ARCall_list.ARCallDate)<=Format(2/2/2010,"mm/dd/yyyy")));


    What am I missing?

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Date issue

    Instead of things like Format(1/2/2010,"mm/dd/yyyy")
    use #1/2/2010#

    There's a difference between the two:
    The first one is a string (date formatted as string) while the second one is a date (internally stored as number)
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    3

    Re: Date issue

    It worked. Thank you!!!

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