user1729807
user1729807

Reputation:

Add day to dateTime in query

I have a table with n records and each record has two field startDate and day and i want to select records that if i add day to startDate , result is >= DateTime.Now

can i do it with query?

Upvotes: 1

Views: 113

Answers (1)

Strawberry
Strawberry

Reputation: 33935

 SELECT * FROM my_table WHERE startdate + INTERVAL day DAY >= NOW();

See juergen d's fiddle: sqlfiddle.com/#!2/eeb77/1

Upvotes: 1

Related Questions