Confusing SQL Queries With Dates

Query to get latest date:

Select item, max(inventorydate)
from table
where inventorydate is < ‘6/30/2011’

Query to retrieve not more than 6 years from application date:

Select item from table

where appl_date >= (Currentdate – 6 Years)

Selecting date between two dates:

WHERE CP.ActionDate BETWEEN '19/12/2012' AND '1/17/2013'

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.