just wanted ur thoughts and do i need a begin at the start of each if?
thx
============================================================== CREATE FUNCTION dbo.CurrencyConvert(@StartCurrency Char, @Subtotal Real,@DateDelivered DateTime) RETURNS Real As BEGIN
DECLARE @Result Real , @DateTemp DateTime, @ExRate real Set @DateTemp = @DateDelivered WHILE (SELECT DateTx FROM Exchange WHERE Exchange.DateTx = @DateTemp) = 0 BEGIN Set @DateTemp = @DateTemp + 1 END
SELECT ExchRate2 from Exchange WHERE Exchange.DateTx = @DateTemp Set @ExRate= ExchRate2
IF CharIndex(@StartCurrency, 'USD') <> 0 SET @Result = @Subtotal * @ExRate ELSE SET @Result = @Subtotal
no, only if you have more than one statement - but it's clearer if you do.
========================================== 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.
I know you mentioned you are young and you have just started your first job after college, but try to use proper english (more or less) in your questions and posts in forums such as these to be taken seriously. Abbreviations like "ur" and "any1" label you as a script kiddie or an AOL chatter, whether that's accurate or not ... especially in email correspondence at work or technical documentation/notes.
No self-respecting real programmer uses "kewl h4ck3r" lingo like that ... (I actually just learned what "l33t" means just a few weeks ago !)