Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Friday, March 30, 2012

How do I add todays date?

I am new to Reporting Services and I need to kno how to add todays date to my
reports.
ThanksI found it in , Expressions, Globals, Execution Time
"Vincel2k2" wrote:
> I am new to Reporting Services and I need to kno how to add todays date to my
> reports.
> Thanks|||Just add a TextBox field and set its value to :
=System.DateTime.Now.ToString()
If you only want the date, you shoud use :
=System.DateTime.Now.ToShortDateString()

Wednesday, March 28, 2012

How do I ... loop horizontal?

If I have the raw data dumped into a big table as following:

Date P R M E Date P R M E Date P R M E Date P R M E
1/1/90 1 2 3 4 1/1/90 2 3 4 5 1/1/90 3 4 5 6 1/1/90 4 5 6 7
...
1/1/05 1 2 3 4 1/1/05 2 3 4 5 1/1/05 3 4 5 6 1/1/05 4 5 6 7

And this table has a repeating block [D, P, R, M,E] 300 times. Is it possible to write a loop query/stored procedures/triggers (or whatever it is) to read each repeating block and stack them on top of each other to insert into another table which has the same structure as following?

Look like this?
Date P R M E
1/1/90 1 2 3 4
...
1/1/05 1 2 3 4
1/1/90 2 3 4 5
...
1/1/05 2 3 4 5
1/1/90 3 4 5 6
...
1/1/05 3 4 5 6

If there is a solution would you please elaborate, example?
Thank you for the help.
shiparsonsUsing Perl this would be relatively easy (basically a one line script).

Using pure SQL Server tools (BCP and Transact-SQL), it can be done, but it would be rather ugly.

I'd try to request the data in another format. It would be easier if it was provided in a "cleaner" format. If that isn't a choice, look at the tools that you've got to see what makes the most sense, then use that to fix the problem.

-PatP|||I know when I'm looped I'm usually horizontal :D|||you're not drunk if you can lie on the floor without holding on|||shiparsons, please do not post two threads with the same subject on the same forum. If you have additional information, just append it as a new post.

If the number of blocks is constant, you could do this as a single butt-ugly UNION statement.

Otherwise, it is dynamic SQL time for you.

I may have a dynamic SQL algorithm that would be pretty concise for you. I'll try it in the morning if nobody else posts it first...|||You can use a simple for loop in DOS/NT Shell language to parse the file and generate new output to a redirected file if you do not have access to perl or a tool such as MKS Toolkit

It may be a bit of of work since you have multiple rows on a single line.

Google "for loop" "DOS" and you should be able to get some assistance.|||Here is some code that selects N columns at a time from any table.

You can modify it to do inserts, if you would like.

declare @.ColumnString varchar(500)
declare @.ColumnCounter int
declare @.ColumnIncrement int
declare @.TableName varchar(500)
declare @.NumColumns int

set @.ColumnIncrement = 3 --Number of columns to return for each statement
set @.TableName = 'TableName' --Name of your target table

set @.ColumnCounter = 0
set @.NumColumns =
(select count(*)
from sysobjects
inner join syscolumns on sysobjects.id = syscolumns.id
where sysobjects.name = @.TableName)

while @.ColumnCounter < @.NumColumns
begin
set @.ColumnString = null
set @.ColumnCounter = @.ColumnCounter + @.ColumnIncrement

select @.ColumnString = isnull(@.ColumnString + ', ', '') + syscolumns.name
from sysobjects
inner join syscolumns on sysobjects.id = syscolumns.id
where sysobjects.name = @.TableName
and colid > @.ColumnCounter - @.ColumnIncrement
and colid <= @.ColumnCounter
order by colid

exec ('select ' + @.ColumnString + ' from ' + @.TableName)
end|||Thank you for the suggestion and assistance.
I am trying to avoid using other "Langauage/command" and use SQL instead. I belive there should be a way to achieve what I am trying to do within SQL. It may need multiple steps.

I appreciate any brainstorming and help.
shiparsons|||Did you try the code I posted?|||Blindman,
Thank you for the help. I guess while I was composing my respose you just posted the code. Anyway, I will try and definitely let you know.

Many thanks,
shiparsons|||Blindman,
I have tried the code... You are the best! It works exactly what I want!

I tried to modify the code to insert into a table but got error message:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test1Date'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test2Date'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test3Date'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test4Date'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test5Date'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test6Date'.
....

Here is the code I modified. Any suggestion? Thank you in advance for the help!!
declare @.ColumnString varchar(500)
declare @.ColumnCounter int
declare @.ColumnIncrement int
declare @.TableName varchar(500)
declare @.NumColumns int
declare @.Staging varchar(500)

set @.ColumnIncrement = 8
set @.TableName = 'TestTable'
set @.Staging= 'Staging'
set @.ColumnCounter = 0
set @.NumColumns =
(select count(*)
from sysobjects
inner join syscolumns on sysobjects.id = syscolumns.id
where sysobjects.name = @.TableName)

while @.ColumnCounter < @.NumColumns
begin
set @.ColumnString = null
set @.ColumnCounter = @.ColumnCounter + @.ColumnIncrement

select @.ColumnString = isnull(@.ColumnString + ', ', '') + syscolumns.name
from sysobjects
inner join syscolumns on sysobjects.id = syscolumns.id
where sysobjects.name = @.TableName
and colid > @.ColumnCounter - @.ColumnIncrement
and colid <= @.ColumnCounter
order by colid

exec ('insert into' + @.staging + 'select ' + @.ColumnString + ' from ' + @.TableName)

end|||Why are you inserting into your staging table? I though the idea was to transform data while populating production tables?

I think it is erroring out because your dynamic INSERT statement does not list which column(s) to insert into.

Copy this just before your EXEC statement and see what code it is trying to run:

'insert into' + @.staging + 'select ' + @.ColumnString + ' from ' + @.TableName

If your Query Analyzer is set to output Text results then you can just copy the output into another QA window and execute it directly to trace your error.

Error tracing is one of the challenges of dynamic SQL.|||I still need to do some manipulations before load into production table. Thats why I need to insert into staging table.

I tried the code right before EXCE statement and still got error message:

Server: Msg 170, Level 15, State 1, Line 30
Line 30: Incorrect syntax near 'insert into'.

Any idea?

Thanks|||Comment out the EXEC statement so that you don't throw the error anymore, and instead post the dynamic SQL statement that would be executed.|||I replaced Exec (..) with the command :

'insert into' + @.staging + 'select ' + @.ColumnString + ' from ' + @.TableName

And run the entire code. However, I am still getting the error:
Server: Msg 170, Level 15, State 1, Line 32
Line 32: Incorrect syntax near 'insert into'.

What part is incorrect? I could not figure it out.

Thanks for the help again.
shiparsons|||how 'bout:

Declare @.sql varchar(8000), @.staging sysname, @.ColumnString varchar(12), @.TableName sysname, @.debug bit

Select @.staging = '@.t1', @.TableName = '@.t2', @.ColumnString = 'c2', @.debug = 0

Select @.sql = 'Set NoCount On Declare @.t1 table(c1 int) Declare @.t2 table(c2 int)'
Select @.sql = @.sql + char(10) + 'Insert @.t2 (c2) Select 1 Union Select 2'

Select @.sql = @.sql + char(10) + 'insert ' + @.staging + ' select ' + @.ColumnString + ' from ' + @.TableName
Select @.sql = @.sql + char(10) + 'Select * From @.t1; Select * From @.t2'

If @.debug = 1 Select @.sql
Else Exec (@.sql)|||Blindman,
I think I know the problem is...
The entire code you posted which pulls out the results I want and in addition it stacks all the column headings as well. That's why when I insert into 'staging table' error msg shows up.

Here is the example of what I mean:
the results from running the code

date column1 column2... column8
data set...
date column10 column11...column16
data set...
...

I have defined datatype for each column of my staging table as (date datetime and all else is float). That is why 'insert into' caused error. Is there any a way to modify or skip the headers?

Any suggestions are welcome!
Thanks for the help!
shiparsons|||I hope you meant that you replaced it with

SELECT 'insert into' + @.staging + 'select ' + @.ColumnString + ' from ' + @.TableName

It should not give you an error...

...and yes, it is likely that the problem is a lack of specifed columns for your insert statement. If the column names are the same, you should be able to run something like this:

exec ('insert into' + @.staging + '(' + @.ColumnString + ') select ' + @.ColumnString + ' from ' + @.TableName)|||Blindman,
I think the code should be:
exec ('insert' + 'into' + @.staging + '(' + @.ColumnString + ') select ' + @.ColumnString + ' from ' + @.TableName)

And I am still getting the error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test1Date'.
...
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Test32Date'.

Unfortunately, all columns names are different ( total 32 which is standard for each input file).

Any other ideas?
Thanks.

MaxA,
I like your code which is simpler, however, like the problem i have with the code Blindman posted. Your code will mix the column headings into the results as well. I need to insert the results into staging table which has each datatype defined as either datetime or float. Is there a way not pulling the column headers as a part of results?

Results from your code
c1
----
1
2

c2
----
1
2

expected results so that I can insert into staging table
c1
----
1
2

1
2

Any help is highly appreciated!
shiparsons|||"exec ('insert' + 'into' + @.staging + '(' + @.ColumnString + ') select ' + @.ColumnString + ' from ' + @.TableName)"?

No, there isn't any need to split 'insert into' into 'insert' + 'into', which won't work anyway because you ommited the space character, and so it concatenates to "insertinto". That is certain to throw a syntax error.

To get around the different column names, try creating a view(s) based upon either your staging table or your production table that aliases the column names so they are compatible. Then reference the view in your statements rather than the table itself.

But it you are trying to insert into your staging table and your staging table is the same poorly designed schema you mentioned in your first few posts, then I think you are screwed because you are going to have a tough time getting your INSERT statement to insert into columns 1-5 on one run, 6-10 on then next, and so on...|||The results you are seeking are unexpected.

Remove ; Select * From @.t2 from my example - it was put there to demonstrate the accuracy of the Select * From @.t1.|||Blindman,
Here is the right code to insert into a table, which works exactly what I want!

insert into tablename
exec ('select ' + @.ColumnString + ' from ' + @.TableName)

Many thanks to everyone who replied this thread!

shiparsons

Friday, March 23, 2012

How could I pass a parameter to DTS package?

I build a DTS package to get data from Oracle.
The data I want may be yesterday, may be two days ago or may be others. So I need a date parameter to tell the package how to get the data. But I do not know how to do it.Lots of ways to skin this cat; depends on exactly what you want to do. From your question, it was not entirely clear to me what you were trying to achieve. One way to set a parameter inside a DTS package is to use a "Set Dynamic Properties" task to set the value of a global variable. Then use the global variable inside a Data Pump (use a '?' inside the SQL Query to place a parameter and finally associate the parameter(s) to the '?' by clicking on the "parameters" button underneath the SQL Query window.

Another way is to set a package level global variable from a separate DTS package (or from a VB Script) and then call the target DTS package. This is done sometimes when a loop mechanism is needed.

Set oWatchlistPackage = CreateObject("DTS.Package2")
oWatchlistPackage.LoadFromSQLServer "myserver",,,256,,,,"MyDTSPackage"

oWatchlistPackage.GlobalVariables.Item("sFileName").Value = oRS("ORIG_FILE_NAME")
oWatchlistPackage.GlobalVariables.Item("iAgency").Value = oRS("AGENCY")
oWatchlistPackage.GlobalVariables.Item("sUserName").Value = oRS("MODIFIED_BY")
oWatchlistPackage.GlobalVariables.Item("iFileID").Value = oRS("FILE_ID")

oWatchlistPackage.Execute

In either case, consult with www.sqldts.com and do a search using Google. You'll find quite a few other (and probably better) examples out there.

Regards,

hmscott

Wednesday, March 21, 2012

how clustering works?

Hi,

I am having data like this

Studid Date Perf

001 01/01/2008 90

001 02/01/2008 89

001 03/02/2008 91

002 01/01/2008 75

002 02/01/2008 79

002 03/02/2008 69

I gave Perf as PREDICT. When I use the

"SELECT * FROM [Cluster_Model]"

Query I am getting

Perf

82.

Can anyone help me how clustering works? and how to write a Query to group the values here based on StudId?

Based on the query result, it seem that your model uses Perf as a Predictable column.

First, how to solve the clustering problem:

Make sure the Studid column is used as an Input attribute (and not a key). If you only want to use Studid to build clusters, then ignore all other columns.

Once the model is trained, the cluster of a new data point can be determined with a query like:

SELECT Cluster() FROM [Cluster_Model] PREDICTION JOIN <new data>

Note that Cluster() is a function computed by the model on top of new data, and not a predictable variable.

If you need to see the distance from the new data point to all the clusters, then the query should look like:

SELECT PredictHistogram( Cluster() ) FROM [Cluster_Model] PREDICTION JOIN <new data>

Now, here is what the query does (and explanation of the results):

The query executes a prediction, based on the model, against new data (general DMX syntax, not related to clustering yet). The prediction is executed for all the predictable attributes of the mining model (*), i.e. Perf and the new data is empty (all attributes have the missing state).

Now, here is how Clustering prediction works: the algorithm computes the distances from the input data point to all the clusters, then predicts the target attribute by using a weighted average between the distributions of the target attribute across all the clusters.

If you want to cluster by Studentid only, but still make predictions for Perf (based on the distribution of Perf in the clusters), then make sure that Studentid is Input and Perf is Predict Only

Hope this helps

How Change field value triggered by date?

In a table i had field called Status and it is of type integer and another two field From and To ... they are of type date .....
what i want to do is to change the value of status field when the current date become equal to the From field and also make another change when the current date become equal to the To field ...

So How can i do This on SQL server 2005?

You need to run a query to update the rows, something like this

UPDATE mytable
SET Status = CASE
WHEN datediff(d, From, getdate()) = 0 THEN 1
WHEN datediff(d, To, getdate()) = 0 THEN 2
END

You could create a calculated column based on the same expression if you want status to always be up to date without running the query first. Otherwise schedule a job to run that query every night so that the status column is always correct.

|||

Thank You for your reply and it is helpful,

But what if the From and To fields in a child table to the original table that have the field status?

e.x. Master Table have the following fields:

PersonID, Name, Status

Details Table has the following fields:

ID,PersonID (as foreign key to the master table), From, To

How the query will look like?!

|||

UPDATE mastertable
SET Status = CASE
WHEN datediff(d, detailtable.From, getdate()) = 0 THEN 1
WHEN datediff(d, detailtable.To, getdate()) = 0 THEN 2
END
FROM mastertable
INNER JOIN detailtable ON mastertable.PersonID = detailtable.PersonID

Monday, March 19, 2012

How can you tell the date of the last full database backup?

How can you tell the date of the last full database backup?
Is there a system table that can be queried?
Robert Alexander
Robert.Alexander@.cca-audit.com
SELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
ORDER BY backup_finish_date DESC
http://www.aspfaq.com/
(Reverse address to reply.)
"Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> How can you tell the date of the last full database backup?
> Is there a system table that can be queried?
> Robert Alexander
> Robert.Alexander@.cca-audit.com
>
>
|||Close. You have to use the type column if there are log and/or differential
backups from that database. 'D' for Database, 'I' for Differential, 'L' for
Log. So that gives:
SELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
AND [TYPE] = 'D'
ORDER BY backup_finish_date DESC
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e36MweNyEHA.804@.TK2MSFTNGP12.phx.gbl...
> SELECT TOP 3 *
> FROM msdb..backupset
> WHERE database_name=DB_NAME()
> ORDER BY backup_finish_date DESC
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
> news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
>

How can you tell the date of the last full database backup?

How can you tell the date of the last full database backup?
Is there a system table that can be queried?
Robert Alexander
Robert.Alexander@.cca-audit.comSELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
ORDER BY backup_finish_date DESC
http://www.aspfaq.com/
(Reverse address to reply.)
"Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> How can you tell the date of the last full database backup?
> Is there a system table that can be queried?
> Robert Alexander
> Robert.Alexander@.cca-audit.com
>
>|||Close. You have to use the type column if there are log and/or differential
backups from that database. 'D' for Database, 'I' for Differential, 'L' for
Log. So that gives:
SELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
AND [TYPE] = 'D'
ORDER BY backup_finish_date DESC
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e36MweNyEHA.804@.TK2MSFTNGP12.phx.gbl...
> SELECT TOP 3 *
> FROM msdb..backupset
> WHERE database_name=DB_NAME()
> ORDER BY backup_finish_date DESC
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
> news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
>

How can you tell the date of the last full database backup?

How can you tell the date of the last full database backup?
Is there a system table that can be queried?
Robert Alexander
Robert.Alexander@.cca-audit.comSELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
ORDER BY backup_finish_date DESC
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> How can you tell the date of the last full database backup?
> Is there a system table that can be queried?
> Robert Alexander
> Robert.Alexander@.cca-audit.com
>
>|||Close. You have to use the type column if there are log and/or differential
backups from that database. 'D' for Database, 'I' for Differential, 'L' for
Log. So that gives:
SELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
AND [TYPE] = 'D'
ORDER BY backup_finish_date DESC
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e36MweNyEHA.804@.TK2MSFTNGP12.phx.gbl...
> SELECT TOP 3 *
> FROM msdb..backupset
> WHERE database_name=DB_NAME()
> ORDER BY backup_finish_date DESC
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
> news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> > How can you tell the date of the last full database backup?
> >
> > Is there a system table that can be queried?
> >
> > Robert Alexander
> > Robert.Alexander@.cca-audit.com
> >
> >
> >
> >
>

Friday, March 9, 2012

how can NULL be equal to todays date (was "Weird Query behavior plz help")

I have a query that is behaving a little a weird. here is the example:

i have 1 table in this table i have 2 columns wich are date and time

DATE_DEBUT_PERIODE_FISCALE DATE_FIN_PERIODE_FISCALE
---------- --------
1/27/1997 2/27/1997
1/1/2005 2/6/2005

here is my query:

BEGIN
declare @.datefin_flag datetime, @.strip datetime
SELECT @.strip = dateadd(d,datediff(d,0,getdate()),0)
SELECT @.datefin_flag = DATE_FIN_PERIODE_FISCALE FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < @.strip AND DATE_FIN_PERIODE_FISCALE = @.strip
--select @.datefin_flag
--select @.strip
IF(@.datefin_flag != @.strip)
RAISERROR('You cant run this',16,1)
END

Well this Query should return the raiserror it returns completes successfuly
since todays date is not the same as the date in the database.
if you select @.datefin_flag it returns NULL and if you select @.strip it brings back todays date how can NULL be equal to to todays date assuming that todays date is equal to NULL. ?Your code is checking for NOT equal. NULL is not equal to anything (including another NULL).

-PatP|||Crap...didnt think of that how would i go about fixing this based on my expresion since if it looks in the table and doesnt find anything.|||How about:IF(@.datefin_flag != @.strip OR @.datein_flag IS NULL)
RAISERROR('You cant run this',16,1)
END-PatP|||I'd write it this way...

IF NOT EXISTS( SELECT *
FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < dateadd(d,datediff(d,0,getdate()),0)
AND DATE_FIN_PERIODE_FISCALE = dateadd(d,datediff(d,0,getdate()),0)
)
RAISERROR('You cant run this',16,1)
END

But I'd handle the raise a little differently

http://weblogs.sqlteam.com/brettk/archive/2004/05/25/1378.aspx|||Thanks alot Pat worked fine i realy apreciated.|||thanks also Brett that is a realy good alternative|||Your welcome...

But it's not really an alternative...

Wednesday, March 7, 2012

How can i use the formula in crystal report 8.5

Hello,
is there somebody who can help me to create a formula in crystal report 8.5.
this formula must convert a date ex : "01/01/1970 0:00" in unix format

I know the code in vb

rounddown( ((value +7200)/86400) + "01/01/1970"),0)

somebody can help me to do this with formula in crystale report

thansk for your cooperationhere after you will find the solution to convert a unix(UTC) time in to a normal date
DateAdd('s',{call_req.open_date},CDATETIME(1970,01,01,0,0,0))

Friday, February 24, 2012

How can I use getdate() to be an input parameter in a sproc?

I am trying to write a sproc that automatically uses the system date (i.e. -
getdate()) as an input parameter. Even though it displays it does not beha
ve like an input parameter.Casey
Do you need the entire date down the minutes and seconds, in other words, an
exact snapshot
of the date?
If not, you can just refer to GETDATE() right within your procedure and
bypass the
parameter part.
"Casey" <cevans2@.edd.ca.gov> wrote in message
news:57B71663-C451-45D0-BB67-FE2B21BCCA25@.microsoft.com...
> I am trying to write a sproc that automatically uses the system date
(i.e. - getdate()) as an input parameter. Even though it displays it does
not behave like an input parameter.|||Hi,
Use the below sample,
alter proc test_proc2
as
begin
declare @.to_day smalldatetime
set @.to_day = getdate()
select @.to_day
end
Incase if it is a must to have date as input parameter then,
alter proc test_proc2 @.to_day datetime = '01/01/1900'
as
begin
set @.to_day = getdate()
select @.to_day
end
Thanks
Hari
MCDBA
"Casey" <cevans2@.edd.ca.gov> wrote in message
news:57B71663-C451-45D0-BB67-FE2B21BCCA25@.microsoft.com...
> I am trying to write a sproc that automatically uses the system date
(i.e. - getdate()) as an input parameter. Even though it displays it does
not behave like an input parameter.

How can I use a Date Picker in a report

I have a parametrized report which actually uses a combo with dates to render the report. And I want to change it for a Date picker. Can I do it?

Thanks in advance.VectorR3,

You can do this ins Reporting Services 2005, not in Reporting Services 2000. Go to "Reports", "Report Parameters". In here change the type on your field to a datetime field. Then when you select preview report you will see the calendar button for that parameter. You will also see it in the Report Manager when you run it.|||Hi,

I am using MS SQL Server 2205 Developer Edition Beta 2 (September 2004 release), but I cannot see the calendar button you mentioned. Is it becuase my version is old & does not have the feature. I am selecting the parameter data type as 'datetime'. Please advice.

Thanks in advance,|||That's right - the date picker was added after Beta 2 (from what I can recall, it first appeared in the June CTP). At this point, Beta 2 is way out of date, and you should be looking at the released version, if possible ...

How can I use a Date Picker in a report

I have a parametrized report which actually uses a combo with dates to render the report. And I want to change it for a Date picker. Can I do it?

Thanks in advance.VectorR3,

You can do this ins Reporting Services 2005, not in Reporting Services 2000. Go to "Reports", "Report Parameters". In here change the type on your field to a datetime field. Then when you select preview report you will see the calendar button for that parameter. You will also see it in the Report Manager when you run it.|||Hi,

I am using MS SQL Server 2205 Developer Edition Beta 2 (September 2004 release), but I cannot see the calendar button you mentioned. Is it becuase my version is old & does not have the feature. I am selecting the parameter data type as 'datetime'. Please advice.

Thanks in advance,|||That's right - the date picker was added after Beta 2 (from what I can recall, it first appeared in the June CTP). At this point, Beta 2 is way out of date, and you should be looking at the released version, if possible ...