Showing posts with label yyyy-mm-dd. Show all posts
Showing posts with label yyyy-mm-dd. Show all posts

Wednesday, March 7, 2012

Format result of sp_helpdb

Hello.

How to format field "create" (Jan 12 2005) in sp_helpdb
procedure to sth like yyyy-mm-dd (2005-01-12) in SQL?

bye...

--
__ __
|__\\ | || |_// / \\ \_// FreeBSD: The Power To Serve
|__// |__|| | \\ \__// / \\ +----------+
+[ http://bukox.prv.pl ][ http://total.bukox.dmkproject.pl ]+[BuKoX] (bukoxSPAMEROM_MOWIMY_NIE@.tlen.pl) writes:
> How to format field "create" (Jan 12 2005) in sp_helpdb
> procedure to sth like yyyy-mm-dd (2005-01-12) in SQL?

You would have to write your own version of sp_helpdb to that end. While
the source code is in master, I don't think it's worth the effort for
such a little change.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 24, 2012

Format Date Parameter in a Report

Hi,
Can I get a Date Parameter that the user filled and format it to
'yyyy-mm-dd' format, so I could execute the Query with the formated date?
LimorIf you are Trying what I think you are trying ...
Here is something you could try
Create a Dataset for your Date Values
I named mine DATE
in the Query type
--
SELECT
LABEL = LEFT([DATEFIELDNAME],11), --WRITES AUGUST 30 2005
VALUE = [DATEFIELDNAME] --WRITES 2005-08-30 00:00:00.000
FROM dbo.SALES
GROUP BY [DATEFIELDNAME]
ORDER BY [DATEFIELDNAME] DESC
--
Then Create a Parameter for your date
I named mine BDATE
DATATYPE = STRING
AVAILABLE VALUES = FROM QUERY
DATASET = DATE (NAME I CREATED)
VALUE = VALUE (THIS IS WHAT THE QUERY IN THE DATASET WILL SEE)
LABEL = LABEL ( THIS IS WHAT THE CLIENT WILL SEE)
--OPTIONAL
DEFAULT QUERY = FROM QUERY
DATASET = DATE
VALUE = VALUE
--
In the dataset that runs the Query for the report you would then have your
date field = @.BDATE (cap sensitive)
I hope this helps and is what you were looking for :)
"Limor Bellison" wrote:
> Hi,
> Can I get a Date Parameter that the user filled and format it to
> 'yyyy-mm-dd' format, so I could execute the Query with the formated date?
> Limor|||Hi,
Thank you for your prompt answer.
I cannot use your solution for 2 reasons:
1-The dates combo box will be too long
2-I get the dates by Url and there is a chance that the date in the combo
will not include the date in the Url query
Thanx,
Limor
"EsWallace" wrote:
> If you are Trying what I think you are trying ...
> Here is something you could try
> Create a Dataset for your Date Values
> I named mine DATE
> in the Query type
> --
> SELECT
> LABEL = LEFT([DATEFIELDNAME],11), --WRITES AUGUST 30 2005
> VALUE = [DATEFIELDNAME] --WRITES 2005-08-30 00:00:00.000
> FROM dbo.SALES
> GROUP BY [DATEFIELDNAME]
> ORDER BY [DATEFIELDNAME] DESC
> --
> Then Create a Parameter for your date
> I named mine BDATE
> DATATYPE = STRING
> AVAILABLE VALUES = FROM QUERY
> DATASET = DATE (NAME I CREATED)
> VALUE = VALUE (THIS IS WHAT THE QUERY IN THE DATASET WILL SEE)
> LABEL = LABEL ( THIS IS WHAT THE CLIENT WILL SEE)
> --OPTIONAL
> DEFAULT QUERY = FROM QUERY
> DATASET = DATE
> VALUE = VALUE
> --
> In the dataset that runs the Query for the report you would then have your
> date field = @.BDATE (cap sensitive)
>
> I hope this helps and is what you were looking for :)
> "Limor Bellison" wrote:
> > Hi,
> >
> > Can I get a Date Parameter that the user filled and format it to
> > 'yyyy-mm-dd' format, so I could execute the Query with the formated date?
> >
> > Limor