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

No comments:

Post a Comment