Link to home
Start Free TrialLog in
Avatar of shilpi2
shilpi2

asked on

Syntax sql2

Hi Experts,

what is wrong with this syntax?
DECLARE @RealStartDate DATETIME
DECLARE @RealEndDate DATETIME
SET @RealStartDate = (
      SELECT MIN(VRD.ValueDate)
      FROM IDX_ValuationRiskDaily VRD
      WHERE
            VRD.ValueDate>= @Start_Date
      AND       VRD.ValueDate< @End_Date
      AND       VRD.PortfolioID = @PortfolioID)


IF @RealStartDate IS NULL THEN
@RealStartDate = @Start_Date
END IF

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Lee
Lee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
too slow!
Whoops, drop the last )