How to display one row of data multiple times - ssms

I'm using SQL Server Management Studio 2014 and have one row of data that I'd like to display multiple times on a report. The data is shown below:
1 ACT 20117843-07 START 2/13/2017 FINISH 2/14/2017
2 ACT 20117843-07 START 2/13/2017 FINISH 2/14/2017
The current report has a group based on the Start date so the information would only appear once on 2/13/2017. However, I've had a request to display the same activity if it isn't scheduled to Finish on the same day as another row on 2/14/2017.
I've never been asked to do this before so I'm not quite sure how to accomplish the request.

You Can Add Adjacent Group to Start Date and FINISH Date in the report

Related

Pentaho data integration issue with loading a kettle based on some condition

I have a Pentaho Data Integration job which has the following steps:
Generate row step which has an initial date (for e.g. 2010-01-01) and the limit as 10*366 = 3660 rows for 10 years.
Next step has an incrementer to increment the number of days.
Next step uses this information viz. initial date, limit, and the incrementer, to generate dates for each day for 10 years starting 2010-01-01 using javascript functions.
Final step loads a table with the generated dates.
All this works fine.
Now, I have a requirement where I do not want this table to be static with dates for 10 years only. If the max date in the date table is 2 years from today, I want to load dates for 10 more years in the table.
For the above example, with the 1st load loading dates for 10 years from 2010, I should be able to load 10 more years in 2018, the next 10 years in 2028 and so on and so forth.
What will be the best way to achieve this?
How can I:
1) Read the max date from my date table? - I know how to do this.
2) Use the read date to compare against today. And if the max date is within 2 years from today, I populate the table with next 10 years.
I don't know how to do 2 above in Pentaho data integration. Will really appreciate any pointers on a way to resolve this issue.
You need to read the current date (today) in a variable. For example with a Get system info step.
Then you can compare the two fields, max date and today, with a Filter Rows step.
As the previous step may give you more than one row, you need to either use a Unique Row (no field to provide) either a Group by (no group by field).
If any row gets by, then you launch you generate 10 years process. As you cannot have a hop from a step into this second Generate row, you must use a Transformation executor to launch your currently existing transformation.
Now, if your requirement gets a tiny little bit more complex than that, I strongly suggest you to use jobs to orchestrate your transformations.

adding times to autofill a field VBA MSAccess

I am making a booking system on MSAccess using VBA. On my form I have fields for creating a new booking which is then to be added to a database on SQL server. I have a combo box set up to allow the user to select and activity and it then fills out the ID of the activity and the duration of the activity. This duration is a number 1 or 2 or 3 etc for how many hours the activity takes.
However my question relates to calculating a finish time for the user. I wish the finish time textbox to be auto filled out when the user selects a start time from a list of times for example, 9:00:00 (To match the format the times are stored on the sql server) and having selected an activity by adding these together. So far I have tried something like this.
Me.txtFinishTime.Text = Me.cmbStartTime.Value + Me.txtDuration.Value
It could be:
Me!txtFinishTime.Value = DateAdd("h", Me!txtDuration.Value, CDate(Me!cmbStartTime.Value))

Analysis to be carried out in SQL

I have a database which captures everyday every column data as binary 0 or 1 in a SQL database. Now I want to calculate what is the avg no. of days a user takes to complete that column. How can I run the query for that?
Please note timeline for every user is different and I want data to be in 3 days slab (for example 1-3,4-6 so on and so forth).

Is there any way let SSRS show the result that NOT included in the last run?

For example:
I preview the report now at 3:00 pm, I want SSRS to show the result that does not show up when I previewed at 2:00pm(last run), and only those records. Thanks
If your dataset is stored procedure based AND your data is time based you could save the last report run time every time it is called in a table. You could then use that value to determine when to start for the next report run. You may need to take into account the user running the report if more than one person will be running it and store a separate last run time for each user.

Generate resource free/busy query using SQL Server

In SQL Server 2005 I have a table with the following columns:
Table Reservations:
ID
arrival datetime
departure datetime
reservation_object (FK to objects table)
Now I need to generate a report that shows for a specified period the status of an object.
This report will have to look like this:
6/1/09 6/2/09 6/3/09 6/4/09 ...
object 1 free free busy busy
object 2 busy free busy busy
...
What is the best way to get this information from SQL server? I'm going to use it in C#.Net.
You may find it easier to pivot the data client side - so ask SQL server for all the appointments that start before the end of the date window you're interested in, but only those that finish after the start of the date window you're interested in.
You can then create a two dimensional array that is logically bookable resource on one dimension, date on the other, with a (potential list of) reservation at each cell -- this would allow you to then drill into details by day without a server round-trip as well...
I decided to use http://www.daypilot.org/scheduler-lite.html.