0

How do I execute a query based on date? As you can see below, I have a table with the attribute PURCHASEDATE as a timestamp. enter image description here My current query is

 String query = "SELECT t FROM TransactionE t WHERE t.purchaseDate = '" + currentDate + "'";

currentDate in this case is "2013-10-22"

My query above would never return a result because of the timestamp. How do I query from a timestamp based on a date?

Thanks guys! =)

Lawrence Wong
  • 1,129
  • 4
  • 24
  • 40

1 Answers1

0

How to return the date part only from a SQL Server datetime datatype

Use the answer given here.

Community
  • 1
  • 1
Daniel E.
  • 2,029
  • 3
  • 22
  • 28