Proper Syntax? - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Databases - MySQL, SQL, Oracle, Access and others

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-02-2008, 12:32 PM   #1 (permalink)
Junior Member
 
Join Date: Aug 2008
Posts: 4
Default Proper Syntax?

When I run my code I seem to get a 'SQL command not properly ended '
Here is my code:

Code:
 'WHERE CLAUS (FILTERS)
 
  tWhereSQL = " WHERE main.active_record <> 'R' "&_
  				" AND main.game_type_id ="& iGameType &_ 
  				" AND main.split_number = -1" &_
				" AND main.league_id IN (1,6)" &_
				" AND main.season = "& iSeason &_
  				" AND main.team_id_1032 = " & iID &_
				" AND gs.team_id = main.team_id" &_
				" AND gs.game_type_id = main.game_type_id" &_
				" AND gs.game_type_desc = main.game_type_desc" &_
				" AND gs.league_id = main.league_id" &_
				" AND gs.league_name = main.league_name" &_
				" AND gs.team_id_1032 = main.team_id_1032" &_
				" AND gs.team_name = main.team_name" &_
				" AND gs.team_nickname = main.team_nickname" &_
				" AND gs.team_abbrev = main.team_abbrev" &_
				" AND gs.season_id = main.season_id"
				
  tWhereOppSQL = " WHERE main.active_record <> 'R' "&_
  				" AND main.game_type_id ="& iGameType &_ 
  				" AND main.split_number = -1" &_
				" AND main.league_id IN (1,6)" &_
				" AND main.season = "& iSeason &_
  				" AND main.team_id_1032 = " & iID &_
				" AND gs.team_id = main.team_id" &_
				" AND gs.game_type_id = main.game_type_id" &_
				" AND gs.game_type_desc = main.game_type_desc" &_
				" AND gs.league_id = main.league_id" &_
				" AND gs.league_name = main.league_name" &_
				" AND gs.team_id_1032 = main.team_id_1032" &_
				" AND gs.team_name = main.team_name" &_
				" AND gs.team_nickname = main.team_nickname" &_
				" AND gs.team_abbrev = main.team_abbrev" &_
				" AND gs.season_id = main.season_id"
				
  tDataSQL = tDataSQL & tWhereSQL & tWhereOppSQL
My question is this code properly formated:
"tDataSQL = tDataSQL & tWhereSQL & tWhereOppSQL "

When I run the output in Querly Analyzer:
Code:
WHERE main.active_record <> 'R'
   AND main.game_type_id = 1
   AND main.split_number = -1
   AND main.league_id IN (1, 6)
   AND main.season = 2007
   AND main.team_id_1032 = 8
   AND gs.team_id = main.team_id
   AND gs.game_type_id = main.game_type_id
   AND gs.game_type_desc = main.game_type_desc
   AND gs.league_id = main.league_id
   AND gs.league_name = main.league_name
   AND gs.team_id_1032 = main.team_id_1032
   AND gs.team_name = main.team_name
   AND gs.team_nickname = main.team_nickname
   AND gs.team_abbrev = main.team_abbrev
   AND gs.season_id = main.season_id
 WHERE main.active_record <> 'R' 
 ...
where the line " WHERE main.active_record <> 'R' " starts for the second function it states "SQL command not properly ended"
vb89 is offline   Reply With Quote
Sponsored Links
Old 11-04-2008, 11:05 AM   #2 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 4
Default Re: Proper Syntax?

Try the following code:

tDataSQL = tDataSQL&" "&tWhereSQL&" "&tWhereOppSQL
jugalboro is offline   Reply With Quote
Old 12-12-2008, 12:28 AM   #3 (permalink)
Junior Member
 
Join Date: Dec 2008
Posts: 24
Default Re: Proper Syntax?

2jugalboro thanXXX
I had such problem also!
Streetwalker is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 05:32 AM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting