+ Reply to Thread
Results 1 to 5 of 5

Need to pass date parameters into query

  1. #1
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Need to pass date parameters into query

    Hello to all,

    I'm trying to get the result of a query to an Access database into Excel and i'm facing problems while issuing the ADODB command, as follows:
    Please Login or Register  to view this content.
    In spite I have records that fill the criteria no records are returned. Can it be something related to syntax?
    Many thanks in advance for any kind help.
    OT

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Need to pass date parameters into query

    It's likely due to date formatting. Try changing date string format to something like 'yyyy-mm-dd'.

  3. #3
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Re: Need to pass date parameters into query

    Many thanks for answering, CK76
    Do you mean something like:
    Please Login or Register  to view this content.
    That gives me error: "Application uses a value of the wrong type for the current operation"
    Thank you
    OT

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Need to pass date parameters into query

    I believe Access by default uses 'yyyy-mm-dd' format.
    Try using that format, if that doesn't work... may be use CDate(string) or DateValue(string)

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Need to pass date parameters into query

    Maybe

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-13-2016, 05:08 PM
  2. Pass parameters in query to Access DB
    By ishq786 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2015, 11:20 PM
  3. Excel query problems with VBA/ADO to iSeries... date formatting, pass variable w/ quotes
    By anthallen_dps in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2013, 05:08 PM
  4. Excel 2007 - Pass Parameters from Excel SQL Query
    By Jeffs23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2009, 11:37 AM
  5. MS Query - Date parameters
    By speedybobbo in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 03-03-2009, 10:47 AM
  6. [SOLVED] Help : Using Parameters with External Date Query
    By Bdavis in forum Excel General
    Replies: 0
    Last Post: 03-31-2005, 12:06 PM
  7. [SOLVED] Is there a way to pass parameters to a web query in excel
    By daytonsupply in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2005, 01:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1