I was trying to get the information from my table Paper_Details based on current date and 15 min before the current time.
and this is my SELECT statement
objcmd.CommandText = "Select * from PAPER_DETAILS where ExamDate = Convert(date, getdate()) and StartTime = (Convert(time, getdate()) - 15)"
But, it is showing this error
Type date is not a defined system type.
Type time is not a defined system type
I’m using SQL Server 2005 and ASP.NET using VB.
I refer the above query from here
Thanks in advance !!
UPDATED
StartTime | ExamDate
____________________|_____________________________
1/1/1900 4:20:00 PM | 7/27/2012 12:00:00 AM
The sample data of my table, which will help you to understand the scenario.
From, the above sample data, i wanted that, user can view the information respective to that row only on 7/27/2012 from 4:05:00 PM to 4:20:00 PM. I hope, everyone understood my scenario.
this is what, i finally got
And, verified with some sample data, it works fine.!!!