MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
SELECT C.CATEGORYNAME, A.ITEMNAME, B.QUANTITY, (SELECT MRP FROM STOCKENTRY WHERE ITEMID = A.ITEMID AND RECORDID = (SELECT MAX(RECORDID) FROM STOCKENTRY WHERE ITEMID = A.ITEMID)) AS ITEM_MRP, B.QUANTITY * (SELECT MRP FROM STOCKENTRY WHERE ITEMID = A.ITEMID AND RECORDID = (SELECT MAX(RECORDID) FROM STOCKENTRY WHERE ITEMID = A.ITEMID)) AS VALUE FROM ITEMMASTER A, STOCKENTRY B, CATEGORYMASTER C WHERE A.ITEMID=B.ITEMID AND C.CATEGORYID = (SELECT CATEGORYID FROM ITEMMASTER WHERE ITEMID = A.ITEMID) AND B.INVOICEDATE BETWEEN @DATE1 AND @DATE2 GROUP BY C.CATEGORYNAME, B.INVOICEDATE, A.ITEMNAME
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|How to check if SQL server database is being backed up by SQL management studio ?||13||82|
|sql, how to change the data type after data loading?||9||61|
|Migrate SQL 2005 DB to SQL 2016||4||32|
|Convert DateTime format in SQL query||10||25|
Join the community of 500,000 technology professionals and ask your questions.