I have a question
Can we convert date 20-06-2011 (dd-mm-yyyy) into 0611 using sql (SQL server database) ?
And
Can we count ID below
keeping in mind last 4 digits which represent date (last 4 digits represent date in the form MMYY) so numbers with last 4 digits 0611 count should be 3
What would be the SQl Query for the count?
ID
AOB2340511
AOB4560511
AOB3500611
AOB4410611
AOB5120611
AOB1250411
EDIT: Corrected DATE data type option.
If your date fields are DATE data types you can do the following.
If your date fields are stored as a string type, such as VARCHAR, NVARCHAR, etc, then try the following
For the question about count, you can try this
If you need a query for the count that also shows the ID value, give this a try