Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Hey all you SQL gods

Author  Topic 

Danny4003
Starting Member

40 Posts

Posted - 2007-01-18 : 18:58:10
I have a question about declaring local varibles. my syntax goes like this:

Declare @Price money,
Declare @Time char(14),
Declare @Acres Decimal(9,3),
SET @Price = '255',@Time = '90',@Acres = 123.213,
Select (@Time * @Acres) AS Delay_Rentals

what else do i need to have here to complete this plz any help is accepted
Thanx
Danny

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-18 : 19:23:43
Well what are you trying to do.

Declare @Price money,
Declare @Time char(14),
Declare @Acres Decimal(9,3),
select @Price = 255,@Time = '90',@Acres = 123.213,
Select (@Time * @Acres) AS Delay_Rentals

@Time shouldn't be a character if you are using it in calculations although it will implicitly convert if valid.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-01-18 : 19:26:57
You have a lot of syntax errors.

Remove the commas at the end of the DECLARE statements.
Change the SET statement to a SELECT statement, remove the quotes, and remove the comma at the end.




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -