 |
|
 |
|
Next: Design philosophy: columns that specify a mode or..
|
| Author |
Message |
External

Since: Jan 31, 2008 Posts: 2
|
(Msg. 1) Posted: Thu Jan 31, 2008 11:38 am
Post subject: Error in SQL code Archived from groups: microsoft>public>sqlserver>programming (more info?)
|
|
|
There is an error within my SQL code that I just can't pick up, does anyone
by any chance know what it is, any help would be greatly appreciated, my
statement is below:
select a.index_id, a.index_name, c.index_date, c.close_index_value,
b.index_id, b.index_name, d.index_date, d.close_index_value from index_master
a, index_master b, daily_index_values c, daily_index_values d where
a.index_id = 24186 = c.close_index_value and b.index_id = 16071 =
d.close_index_value >> Stay informed about: Error in SQL code |
|
| Back to top |
|
 |  |
External

Since: Jan 31, 2008 Posts: 2
|
(Msg. 2) Posted: Thu Jan 31, 2008 12:16 pm
Post subject: Re: Error in SQL code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 31 ene, 13:38, drinese18
wrote:
> There is an error within my SQL code that I just can't pick up, does anyone
> by any chance know what it is, any help would be greatly appreciated, my
> statement is below:
>
> select a.index_id, a.index_name, c.index_date, c.close_index_value,
> b.index_id, b.index_name, d.index_date, d.close_index_value from index_master
> a, index_master b, daily_index_values c, daily_index_values d where
> a.index_id = 24186 = c.close_index_value and b.index_id = 16071 =
> d.close_index_value
Try next time to specify the error message you are facing
Incorrect syntax near '='.
If a.index_id needs to equal 24186 just as c.close_index_value
Try instead:
WHERE
a.index_id = 24186 AND
c.close_index_value = 24186 AND
b.index_id = 16071
d.close_index_value = 16071 >> Stay informed about: Error in SQL code |
|
| Back to top |
|
 |  |
External

Since: Jan 31, 2008 Posts: 2
|
(Msg. 3) Posted: Thu Jan 31, 2008 1:39 pm
Post subject: Re: Error in SQL code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ok the error is gone, thanks Rod, but what happen now is that its not
displaying any data and I know there are values within those fields, its just
that when I try and query them together, they come up blank, what you think
I'm doing wrong?
"Rod" wrote:
> On 31 ene, 13:38, drinese18
> wrote:
> > There is an error within my SQL code that I just can't pick up, does anyone
> > by any chance know what it is, any help would be greatly appreciated, my
> > statement is below:
> >
> > select a.index_id, a.index_name, c.index_date, c.close_index_value,
> > b.index_id, b.index_name, d.index_date, d.close_index_value from index_master
> > a, index_master b, daily_index_values c, daily_index_values d where
> > a.index_id = 24186 = c.close_index_value and b.index_id = 16071 =
> > d.close_index_value
>
> Try next time to specify the error message you are facing
> Incorrect syntax near '='.
>
>
> If a.index_id needs to equal 24186 just as c.close_index_value
>
> Try instead:
> WHERE
> a.index_id = 24186 AND
> c.close_index_value = 24186 AND
> b.index_id = 16071
> d.close_index_value = 16071
> >> Stay informed about: Error in SQL code |
|
| Back to top |
|
 |  |
External

Since: Feb 02, 2008 Posts: 1
|
(Msg. 4) Posted: Sat Feb 02, 2008 10:20 pm
Post subject: Re: Error in SQL code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hi
if you are working in SQL server 2005
you should try
a.index_id = '24186' AND
c.close_index_value =' 24186 ' AND
b.index_id = '16071' AND
d.close_index_value = '16071'
"drinese18" wrote:
> Ok the error is gone, thanks Rod, but what happen now is that its not
> displaying any data and I know there are values within those fields, its just
> that when I try and query them together, they come up blank, what you think
> I'm doing wrong?
>
> "Rod" wrote:
>
> > On 31 ene, 13:38, drinese18
> > wrote:
> > > There is an error within my SQL code that I just can't pick up, does anyone
> > > by any chance know what it is, any help would be greatly appreciated, my
> > > statement is below:
> > >
> > > select a.index_id, a.index_name, c.index_date, c.close_index_value,
> > > b.index_id, b.index_name, d.index_date, d.close_index_value from index_master
> > > a, index_master b, daily_index_values c, daily_index_values d where
> > > a.index_id = 24186 = c.close_index_value and b.index_id = 16071 =
> > > d.close_index_value
> >
> > Try next time to specify the error message you are facing
> > Incorrect syntax near '='.
> >
> >
> > If a.index_id needs to equal 24186 just as c.close_index_value
> >
> > Try instead:
> > WHERE
> > a.index_id = 24186 AND
> > c.close_index_value = 24186 AND
> > b.index_id = 16071
> > d.close_index_value = 16071
> > >> Stay informed about: Error in SQL code |
|
| Back to top |
|
 |  |
| Related Topics: | Error while running the below code[-2147217900] - strconn = " Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=sa;Initial Catalog=TestDB;Data Source=servername" cn.Open strconn strSQL = "SELECT * INTO XLImport8 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data..
Rollback/transaction/error handling code - Hi all, I'm primarily a middle-tier coder who's also administrating the database. I'm not writing any rollback/transaction/error handling code in my sp's. Should I? What are the advantages of inserting this code? What are the dangers of disregarding..
BIDS - Cube calculation designer: Unexpected error occurre.. - Hello, Within 'Business Intelligence Develpment Studio' (BIDS) with a cube opened and the calculations tab selected, the design surface displays a message that reading: Unexpected error occurred: 'Error in the application.' This occurs in any project ...
SQL server error:Error converting data type varchar to float - hi, here is my SQL statement, for some reason, it keeps giving me "Error converting data type varchar to float" error. Anybody news how to resolve it? declare @date as datetime SET @date = (SELECT max( create_Date ) ...
Rollback whole transaction save/keep error message/error s.. - Hi all, In SQL 2005, is it possible to rollback the entire transaction but save/keep the system generated error message/error severity information some where? I tried to store the error message in local memory but once rollback I lost it. Any ideas.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|