SQL Server Performance

date function

Discussion in 'SQL Server Reporting Services' started by jwong008, Jul 19, 2006.

  1. jwong008 New Member

    how can I return the last date of last month?

    Today: 7 July

    Expected return: 30 jun
  2. FrankKalis Moderator

  3. jwong008 New Member

    Thanks alot. It works. Although I actually need the vb code, I found a walkaround.
  4. FrankKalis Moderator

    Good to hear that. I've actually realised after my posting that you've asked about Reporting Services. Isn't the VB code very similar and something like:


    DATEADD("d",DATEDIFF("d",DAY(NOW()),NOW()),0)

    ?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    http://www.insidesql.de
    Heute schon gebloggt?http://www.insidesql.de/blogs

Share This Page