0

I'm relatively new to SQL and need to do the following

  • Split a Date and Time
  • Change the Date
  • Concatenate the New Date with Original Time

Any help on this would be greatly appreciated as Google searches haven't found me anything yet!

Thanks Paul

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

2

Just use the DATEADD function if you want to change part of an existing DATETIME value.

Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date.

For example, if you want to add a month to an existing day:

DATEADD(mm, 1, mydate)
Oded
  • 489,969
  • 99
  • 883
  • 1,009