on 2019 Nov 13 5:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dear
please try
---current year
SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
WHERE YEAR(t0."CreateDate") = YEAR(CURDATE())
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"
---last 7 days record
SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
where DAYS_BETWEEN (t0."CreateDate",CURRENT_DATE) <=7
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This Query is correct because CURDATE() will not work
Please use below query
SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
WHERE YEAR(t0."CreateDate") = YEAR(GetDATE())
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.