Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to display the months based on date

how to display the months based on date

Scheduled Pinned Locked Moved Database
sharepointdatabasetutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vinu 1111
    wrote on last edited by
    #1

    hi.. this is my SP USE [TASKDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[GetCmtRpt] -- Add the parameters for the stored procedure here @logid int AS BEGIN SET NOCOUNT ON; -- Insert statements for procedure here SELECT Date ,From_Name ,To_Name ,Todays_Task ,Tommorrows_Task ,Status,Comments,Date as months from TaskSheet inner join login on TaskSheet .loginID = login.loginID where login.loginID = @logid order by Date desc END i want to display the months field as jan feb mar based on date how to do...?

    B 1 Reply Last reply
    0
    • V vinu 1111

      hi.. this is my SP USE [TASKDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[GetCmtRpt] -- Add the parameters for the stored procedure here @logid int AS BEGIN SET NOCOUNT ON; -- Insert statements for procedure here SELECT Date ,From_Name ,To_Name ,Todays_Task ,Tommorrows_Task ,Status,Comments,Date as months from TaskSheet inner join login on TaskSheet .loginID = login.loginID where login.loginID = @logid order by Date desc END i want to display the months field as jan feb mar based on date how to do...?

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Here it is: SELECT substring(DATENAME(month, getdate()),1,3) AS MonthName


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups