Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time_t curdate = time(0);
- struct tm * tm_curdate = gmtime(&curdate);
- char date_buf[11];
- strftime(date_buf, 11, "%Y-%m-%d", tm_curdate);
- std::stringstream buf;
- buf << "SELECT ..."
- " WHERE my_date >= DATE_SUB(" << date_buf << ", INTERVAL 28 DAY)" <<
- " LIMIT 1";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement