MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

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 March 4th, 2004, 06:58 PM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
Unhappy Syntax question

Hi...I keep getting a .."syntax error near '!' "...on the following statement at the first 'forms!' statement. Can anyone spot the problem?

WHERE (((tblApHistDetail.PartId) Between Forms!frmBSSImPrintChildExpenses.ChildFrom
And Forms!frmBSSImPrintChildExpenses.ChildThru)
AND ((tblApHistDetail.GLAcct) Between Forms!frmBSSImPrintChildExpenses.GLFrom
And Forms!frmBSSImPrintChildExpenses.GLThru) AND ((tblApHistHeader.InvoiceDate)
Between Forms!frmBSSImPrintChildExpenses.DateFrom And Forms!frmBSSImPrintChildExpenses.DateThru))

Your help is appreciated !

Last edited by flaminstar : March 4th, 2004 at 07:02 PM.

Reply With Quote
  #2  
Old March 8th, 2004, 12:01 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
not sure but I think you cann't have an ! in your query

try to replace them with something else then run the query

Reply With Quote
  #3  
Old March 23rd, 2004, 10:11 AM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
I replaced the '!' with a '.' and that seems to have worked. I don't understand why it doesn't work with the '!'...it should. I have another query with a similar command, although it is giving me a different error msg than the other query...it doesn't seem to matter whether it has an '!' or a '.' in the command stream. Should the command not work the same in both queries? Or am I missing something?

Thanks for your help !

Reply With Quote
  #4  
Old March 23rd, 2004, 11:56 AM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
not sure about this but when you're in a form and you want to query a table you need the !
but when you're in queries, the . will always work.

Reply With Quote
  #5  
Old March 23rd, 2004, 03:57 PM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
Here's the error msgs I'm getting now on this query...I've attached the actual query in a .txt file (probably easier to read that way). I'm sure I'm missing something really simple ...

Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'Forms.frmImPrintPmtAdvice' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Forms.frmImPrintPmtAdvice' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Forms.frmImPrintPmtAdvice' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Forms.frmImPrintPmtAdvice' does not match with a table name or alias name used in the query

Thanks again
Attached Files
File Type: txt SLTestqry.txt (2.2 KB, 309 views)

Reply With Quote
  #6  
Old March 23rd, 2004, 07:17 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
try to re-putting the ! in the query to test it

Reply With Quote
  #7  
Old March 24th, 2004, 02:09 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,919 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 12 h 51 m 39 sec
Reputation Power: 1018
isn't Forms! a microsoft access thing?
__________________
r937.com | rudy.ca

Reply With Quote
  #8  
Old March 24th, 2004, 06:47 AM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
I did try putting the '!' back in and got a syntax error. This is a stored procedure I'm trying to create.

Reply With Quote
  #9  
Old March 24th, 2004, 06:38 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
a SP? but what are 'Forms.frmImPrintPmtAdvice' ? parameter you get from your form?

Reply With Quote
  #10  
Old March 24th, 2004, 07:07 PM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
I have a form called 'frmImPrintPmtAdvice' ...in this form are the fields...CheckFrom, CheckThru,CheckDate,PayFrom and PayThru ..
(See the Where statement appended earlier)

Reply With Quote
  #11  
Old March 24th, 2004, 07:11 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
I think you can drop the Forms. in your
Forms.frmImPrintPmtAdvice.CheckFrom

Reply With Quote
  #12  
Old March 24th, 2004, 07:44 PM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
OK...I just tried that...removing 'Forms' from the statement..
I get the similar error ...

"The column prefix 'frmImPrintPmtAdvice' does not match with a table name or alias name used in the query."

Reply With Quote
  #13  
Old March 31st, 2004, 09:14 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
what ever happen? I have no more idea, but I'm curious to what ever you've solve your problem...give me some news

Reply With Quote
  #14  
Old April 1st, 2004, 09:09 AM
flaminstar flaminstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Oshawa
Posts: 8 flaminstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to flaminstar
Hi...I have not solved the problem yet...still working on it. I have been unable as of yet to get anything to work. I have 2 SP's where this works fine ...and these last 2 that give me the same error described in my last post.

Last edited by flaminstar : April 1st, 2004 at 01:02 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Syntax question


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 |