Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 18th, 2003, 01:44 PM
acknight acknight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 acknight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Too few parameters. Expected 1.

Hey all. I'm trying to execute the following SQL statement in VB 6.0.

db.Execute ( "SELECT Year(WO!COMPLETIONDATE)*100+Month(WO!COMPLETIONDATE) AS [Month], Count(WO.WONUM) AS CountOfWONUM INTO Completed2 From WO Where (((WO.REQUESTDATE) < MyDate)) GROUP BY Year(WO!COMPLETIONDATE) * 100 + Month(WO!COMPLETIONDATE) ORDER BY Year(WO!COMPLETIONDATE)*100 + Month(WO!COMPLETIONDATE);" )

The field names are all correct and everything, but I'm getting a "Too few parameters. Expected 1" error. I have no idea why. I put this in directly from Access, and I think I have to change it, but I'm not sure to what. Can any of you help? Thanks.

Reply With Quote
  #2  
Old August 20th, 2003, 02:57 PM
Schway442 Schway442 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 43 Schway442 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 55 sec
Reputation Power: 6
Typically, if I have a problem with an SQL statement, I display it in a label after it is built in my program. Then I cut and paste the output into Access to test if the query runs there. Within Access I make the needed changes to get the query running... after which I format my build statements in VB to match the syntax of the Access query.

Reply With Quote
  #3  
Old September 6th, 2003, 11:11 PM
sjg1624 sjg1624 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 sjg1624 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem

Looks like a Maximo database to me. Depending on your DB backend I would think the Year() or month() might be an issue. I would make sure the query runs in your sqltalk/sqlplus/whatever command line query tool you have.

Reply With Quote
  #4  
Old September 9th, 2003, 11:45 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Hi,acknight!
I think it is incorrect in the end of your sql statement.

It maybe:
db.Execute ( "SELECT ....COMPLETIONDATE)" )
take out the ":"...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Too few parameters. Expected 1.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway