By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,663 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,663 IT Pros & Developers. It's quick & easy.

Sql Statement

100+
P: 134
Hi,

Can anyone tell me what wrong with the statement, when I run the program,
no record was selected.

Please Advise -

rs.Open "SELECT Process.FailureCode, Process.SN, Process.TestDate From Process WHERE not isnull(failureCode) AND TESTDATE>=" & CDate(StartDate) & " And TESTDATE<=" & CDate(EndDate) & " ORDER BY Process.FailureCode, Process.SN,Process.TestDate", conn
Oct 7 '08 #1
Share this Question
Share on Google+
2 Replies


puppydogbuddy
Expert 100+
P: 1,923
Try this:
Expand|Select|Wrap|Line Numbers
  1. Dim strSql As String
  2.  
  3. strSql  = "SELECT Process.FailureCode, Process.SN, Process.TestDate "
  4. strSql = strSql & " From Process" 
  5. strSql = strSql & " WHERE Not IsNull(failureCode) AND TESTDATE >=" 
  6. strSql = strSql & "#" & StartDate & "#" & " And TESTDATE <= #" & EndDate & "#"
  7. strSql = strSql & " ORDER BY Process.FailureCode, Process.SN,Process.TestDate;"
  8.  
  9. rs.Open strSql, conn 
Oct 8 '08 #2

100+
P: 134
Try this:
Expand|Select|Wrap|Line Numbers
  1. Dim strSql As String
  2.  
  3. strSql  = "SELECT Process.FailureCode, Process.SN, Process.TestDate "
  4. strSql = strSql & " From Process" 
  5. strSql = strSql & " WHERE Not IsNull(failureCode) AND TESTDATE >=" 
  6. strSql = strSql & "#" & StartDate & "#" & " And TESTDATE <= #" & EndDate & "#"
  7. strSql = strSql & " ORDER BY Process.FailureCode, Process.SN,Process.TestDate;"
  8.  
  9. rs.Open strSql, conn 
Wow!, it work !!!, thank you so much
Oct 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.