Hi
give code is in access wann to convert into SQL Server help me plz
SELECT PPCR_tbl_Form.PPCRID, PPCR_tbl_Form.StatusID,
DateValue(IIf(DLookUp("PPCRID","QS_PPCR_Approved_Latest","[PPCRID]= " &
PPCR_tbl_Form.PPCRID) Is
Null,[MinRevDate],QS_PPCR_Approved_Lates
t.LatestApprovalDate)) AS
FromDate, DateValue(IIf([PPCR_tbl_Form.StatusID] In
(14,16,17),[MaxRevDate],Now())) AS ToDate
FROM (PPCR_tbl_Form INNER JOIN QS_PPCR_MaxMin_RevDate ON
PPCR_tbl_Form.PPCRID=QS_PPCR_MaxMin_RevDate.PPCRID) LEFT JOIN
QS_PPCR_Approved_Latest ON
PPCR_tbl_Form.PPCRID=QS_PPCR_Approved_Latest.PPCRID
WHERE (((PPCR_tbl_Form.StatusID)<>1))
ORDER BY PPCR_tbl_Form.PPCRID;Sorry. You are going to have to provide DDL and what you are trying to do.|||"san" <skrupareliya@.gmail.com> wrote in message
news:1141430689.221902.287910@.j33g2000cwa.googlegroups.com...
> Hi
> give code is in access wann to convert into SQL Server help me plz
>
>
> SELECT PPCR_tbl_Form.PPCRID, PPCR_tbl_Form.StatusID,
> DateValue(IIf(DLookUp("PPCRID","QS_PPCR_Approved_Latest","[PPCRID]= " &
> PPCR_tbl_Form.PPCRID) Is
> Null,[MinRevDate],QS_PPCR_Approved_Lates
t.LatestApprovalDate)) AS
> FromDate, DateValue(IIf([PPCR_tbl_Form.StatusID] In
> (14,16,17),[MaxRevDate],Now())) AS ToDate
> FROM (PPCR_tbl_Form INNER JOIN QS_PPCR_MaxMin_RevDate ON
> PPCR_tbl_Form.PPCRID=QS_PPCR_MaxMin_RevDate.PPCRID) LEFT JOIN
> QS_PPCR_Approved_Latest ON
> PPCR_tbl_Form.PPCRID=QS_PPCR_Approved_Latest.PPCRID
> WHERE (((PPCR_tbl_Form.StatusID)<>1))
> ORDER BY PPCR_tbl_Form.PPCRID;
>
Hit the Books Online.
Replace IIF with CASE.
Replace DLookup with a scalar subquery.
Replace Now() with GetDate().
David
No comments:
Post a Comment