addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

MySQL date problem

From: user 7.
Sent on: Wednesday, May 20, 2009 2:41 PM
Dear SQL-ers,

I have problem that is large for  me but I hope it is  small for you.


MySQL table  with unix  date field

Goal: reset date from yyyy-mm-01 to  yyyy-prior-mm-15

Thus, `[masked]` would be updated to `[masked]`. Actually,  I would 
like any July date  to be set to June-15.

Along the way I want to select for some  other attributes and  all dates 
for  2009 from July through December but those selections I  have coped 
with already.

I have been futzing around with DATE(date-field,  INTERVAL  -15  DAY)  
and some others  like  DATE_SUB(   ), but I keep getting the  syntax wrong.

Many thanks for any help.

Mike Rulison

Our Sponsors

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy