Forum Replies Created

Viewing 15 posts - 361 through 375 (of 1,468 total)

  • Reply To: tyring to convert a varchar to a Date

    Take a look at the SQL CONVERT function for formatting the dates for display.

    But PLEASE PLEASE PLEASE do not save the dates as varchar.  You will be opening yourself...

    • This reply was modified 6 years, 5 months ago by DesNorton.
  • Reply To: Datediff between dates, but exclude extra leap year day

    below86 wrote:

    I like the simplicity of finding the February 29 dates, then subtracting that DesNorton posted.  But it didn't calculate correctly when I used the start date of 01/01/2019 end...

  • Reply To: Datediff between dates, but exclude extra leap year day

    This can be made more dynamic with a function that gets the FEB29 days

    CREATE FUNCTION dbo.GetLeapYearDates(@Date1 AS date, @Date2 AS date)
    RETURNS TABLE WITH SCHEMABINDING
    AS
    RETURN
    WITH
    ...
  • Viewing 15 posts - 361 through 375 (of 1,468 total)