Link to home
Create AccountLog 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
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
too slow!
Whoops, drop the last )