If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

java script for date formatting required .........

Started by Desperado, 07 Jun 2007 11:03:06 AM

Previous topic - Next topic

Desperado

Hi All,

I'm using a procedure in my report and in that i'm passing todate and from date prompts.
in the report i have to use a date prompt (calendar), But when i'm passing values using dateprompt, it's not showing any data.
i figured out the problem is when i'm using a date prompt the value getting passed is like this : Jan 7, 2007 12:00:00 AM
but my procedure accepts value in this format : 1/7/2007 ie, mm/dd/yyyy.

can anyone give me the javascript for changing the format of the calendar date to mm/dd/yyyy

Thanks in Advance

JoeBass

I've had to do something similar.  I made the conversion in the stored procedure.  Here's a SQL Server example.

CREATE PROCEDURE TEST
   (
      @StartDate DateTime
   )
AS
   DECLARE @StartDateText VarChar(20)
   SELECT @StartDateText = Convert(VarChar, DatePart(DD, @StartDate)) + '/' + Convert(VarChar, DatePart(MM,@StartDate)) + '/' + Convert(VarChar, DatePart(YYYY, @StartDate))

   PRINT @StartDateText
GO

Desperado