SELECT a Date Range

Results 1 to 3 of 3

Thread: SELECT a Date Range

  1. #1
    Marcel Vogel Guest

    Default SELECT a Date Range

    Hi,<BR><BR>I want to select a date range from my Access database that I will convert to a SQL database.<BR><BR>This is what I have:<BR>strSQL = "SELECT * FROM " & strDomainNaam & " WHERE UserName = &#039" & strUserName & "&#039 AND PassWord = &#039" & strPassWord & "&#039 AND DateSignUp > " & Chr(34) & Date - 1 & Chr(34) & " AND DateSignUp &#060; " & Chr(34) & Date + 8 & Chr(34) & ""<BR><BR>But I getting this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e10&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.<BR><BR>Can anybody help me.<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    168

    Default RE: SELECT a Date Range

    StartDate = FormatDateTime((DateAdd("y",-1,Now())),2)<BR>EndDate = FormatDateTime((DateAdd("y",8,Now())),2)<BR><BR>st rSQL = "SELECT * FROM " & strDomainNaam & " WHERE UserName = &#039" & strUserName & "&#039 AND PassWord = &#039" & strPassWord & "&#039 AND DateSignUp > " & "#" & startDate & "# AND DateSignUp &#060; " & "#" & endDate & "#"<BR><BR>Hope this helps... Cheers!

  3. #3
    Marcel Vogel Guest

    Default RE: SELECT a Date Range

    Hi,<BR><BR>You have no idea how happy I am, yes its working....<BR>Many many Thanks..<BR><BR>Marcel Vogel.<BR>

Posting Permissions

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