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

Monday, March 26, 2012

Recovery from Metabase corruption

I've spent most of the day trying to recover my team foundation server from a metabase corruption (no I had not backed it up).

To date I've had to reinstall IIS,uninstall reporting services and reinstall that as well as sts and the other nonsense.

Right now the TFS installer gets most of the way through (for the 10th ) time and reports that it can't access report server.

In IIS http://localhost/reports/home.aspx I get a message

'The feature: "Scale-out deployment" is not supported in this edition of Reporting Services. (rsOperationNotSupported) (rsRPCError)'

So it's possibly correct that Report server is not running. Now whilst I find lots of stuff which tells me how to enable 'Scale-out deployment' I find none which tells me how to disable it (and I don't want to install enterprise edition).

I have reloaded the report server keys which I saved before embarking on this foolishness and that seemed to get me a bit further forward. The only other thing I did was to set the database in the report server configurator (to the local db with ReportServer. It was originally blank).

Please help!

Thanks

Iain

Moved to Reporting. Hopefully someone here can help.

-Matt

sql

Saturday, February 25, 2012

Records Between two date columns

Hi All,
I am having a problem getting records between two date columns. My table is shown below.

SAP_ID JoinDate LeaveDate
1 2006-01-23 00:00:00.000 2006-04-12 00:00:00.000
2 2006-09-04 00:00:00.000 2007-10-10 00:00:00.000
3 2006-10-03 00:00:00.000 2007-01-01 00:00:00.000
4 2007-12-04 00:00:00.000 2007-10-10 00:00:00.000

From asp page i am getting joindate and leavedate . I need to show records between joindate and leavedate.

For ex:
If
JoinDate=2006-01-01
LeaveDate=2007-01-01
then

report should show 1,2,3 SAP No's. But My Query showing only 1, 3. Here is the my query.

select sap_id from tblsap where joindate >= '2006-01-01' and leavedate <='2007-01-01'

I am not able to figure out the problem. Can some one please post suggestions to my problem.

Rajesh

The row 3 has leaveDate greater than 2007-01-01. You can AND logic in where clause and that row doesn't match where clause. So your query won't catch this row. You need understand requirement and make a little change your code.

SAP_ID JoinDate LeaveDate
3 2006-10-03 00:00:00.000 2007-01-01 00:00:00.000

select sap_id from tblsap where joindate >= '2006-01-01' and leavedate <='2007-01-01'

|||

As I understand the problem, you want rows where the 'active' period included any part of the year 2006.

I think that this should accomplish the task.

Code Snippet


SET NOCOUNT ON


DECLARE @.MyTable table
( SAP_ID int,
JoinDate datetime,
LeaveDate datetime
)


INSERT INTO @.MyTable VALUES ( 1,'2006-01-23', '2006-04-12' )
INSERT INTO @.MyTable VALUES ( 2,'2006-09-04', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 3,'2006-10-03', '2007-01-01' )
INSERT INTO @.MyTable VALUES ( 4,'2007-12-04', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 5,'2005-05-15', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 6,'2007-01-01', '2007-10-10' )
INSERT INTO @.MyTable VALUES ( 7,'2005-05-15', '2005-12-31' )


SELECT
Sap_ID,
JoinDate,
LeaveDate
FROM @.MyTable
WHERE ( JoinDate < '2007-01-01' --Join Prior 2007 and
AND LeaveDate >= '2006-01-01' --Leave 2006 or After
)

Monday, February 20, 2012

Record selection formula with Is Null

Hi all ,
Can any one correct my Record selection formula.
if IsNull ({?Start}) and IsNull ({?End})
then
{Query1.Completion Date} in CurrentDate-3 to CurrentDate-1
else
{Query1.Completion Date} in {?Start} to {?End}What if only one of the dates is set?

( IsNull({?Start}) and IsNull({?End})
and {Query1.Completion Date} in CurrentDate-3 to CurrentDate-1
)
or
( Not(IsNull({?Start}) and IsNull({?End}))
and {Query1.Completion Date} in {?Start} to {?End}
)

It's sometimes easier (if only to read) to create a formula for each parameter and use the formula in the record selection.
e.g. formula @.Start
if IsNull({?Start}) then CurrentDate-3 else {?Start}

e.g. record selection
{Query1.Completion Date} in {@.Start} to {@.End}

You might want to check how/whether this affects what's sent to the database (e.g. is the where clause set?)|||Hi Jagan,
Thanks for reply,
I have a report which will be schedule on every Monday at 1 am.
In this report they want Prev Friday to sunday data.So i am using date range
"{Query1.Completion Date} in CurrentDate-3 to CurrentDate-1"
this is the formula I have in my select expert.But some times user want to give his own parameters.So i want create a parameter that by default it has to bring data for prev Fri to Sun and if user select any date range then it has to bring data for that particular range dates..
I know this one we can create using stored procedures is there any other way with out stored procedure.

Record Selection Crystal Reports

I'm trying to get Crystal reports to prompt the user each time they run the report for the company they want to run the report an the date range they want to run the report on. Unfortunatly I can only get it to do the company at run time. In order to filter out the date range and the company I have to use the selection expert which dosent really help my users is there anyway to filter both sets of values when running the report live for the customer?Cant you pass these values thru the Application you are using?

Record Selection - CR9

Hi

I want my report to output data if any one of three date fields is greater or equal to today.

In my record selection i entered "datefield1" >= currentdate OR "datefield2" >= currentdate OR "datefield3" >= currentdate. However, report itself seems to only act after the first datefield is true and does not output data if the others are true. Crystal seems to ignore the subsequent record selections...

Where am I going wrong? Thanks...this is the code that is not working fully.. I have also tried xor

{tblKeyDates.datPODDue}>= currentdate or
{tblKeyDates.datHearing}>= currentdate or
{tblKeyDates.datPt8Iss}>= currentdate|||Is what you've shown the entire record selection formula?