PowerBI - Graphical representation DateTime for room booking - sql-server

I have SQL table with datetime information of room booking
and I need show graphical representation this data in PowerBI for example as this:
Is it possible and how? If not what I can use to get similar results?
Thank you for all answers.

You can use Deneb custom visual for this (certified and free):
https://vega.github.io/vega-lite/examples/bar_gantt.html
https://deneb-viz.github.io/

Related

how to find the real meaning of the specific field

IT guy creates a field under view table. I want to know what the field meaning or the formula behind the scene for this field, such as BT_ACT_RECPTS.AVG_MATERIAL_COST. I want to know how to calculate the average material cost.
I'm using SQL management studio.
thanks.
With the GUI:
Or with code using the object_definition function.

Skype persistent chat timestamp converstion

I am building a tool which displays Skype persistent chat information along with participants information. For one of the requirement, I need to filter the tblComplianceParticipant table in a given date range.
I tried many different approaches to convert tblComplianceParticipant.joinedAt column to human-readable format like 'yyyy-mm-dd', etc. but no luck so far. Data in this column are 18 digit numbers, starting with "63" for example 636572952018269911 and 636455769656388453.
These values are also not in 'windows file time' format because https://www.epochconverter.com/ldap gives the future dates with above values.
I tried looking at #JonSkeet's answer on 18 digit timestamp to Local Time but that is c# specific. I tried to replicate similar logic in SQL but no luck.
Is there any way to convert this 18 digit numbers to normal date format and perform where clause on it?
Online converter which gives desired output: https://www.venea.net/web/net_ticks_datetime_converter#net_ticks_to_date_time_and_unix_timestamp_conversion
However, I was looking for underlying logic to convert it myself as I need to perform where clause on it in SQL server stored procedure.
Our Skype administrator provided me with a SQL function (fnDateToTicks) which was part of Skype database (mgc) (Earlier, I didn't have permission so could not see it). I am verifying with him whether it is an internal IP or standard solution by Microsoft so I can share it with the larger community.
The only thing i can think is worth trying:
select CAST ([Timestamp Column] as datetime)
Which will format it as yyyy-mm-dd 00:00:00:000
This may work for SQL Server 2008 and onwards

free form report with SSRS

I need to create a free form report which contains questions (question groups contain groups of similar questions....for example personal information, medications, emergency contact information etc) and answers for each of the questions for person.
My query goes something like this:
SELECT person.person_Id,
,question_group.name AS Question_Group
,question_instance.name AS QAsked
,question_instance.answer AS QAnswered
FROM person
INNER JOIN question_group....
So when I create a list using SSRS, using this tutorial (https://msdn.microsoft.com/en-us/library/ff519552.aspx) the only thing that appears on my form is the first question and its matching answer for the person...however, I want to be able to show all the questions/answers for each person on a page (so I'm grouping by person_id), and then show the next person and his questions/answers on the next page.
How can I iterate through these questions for each person, and am I able to move each question around in order to design a form, so the first name, last name questions can appear at the top of the page,...the questions which deal with emergency contact would appear middle of the form, etc...
I'm using SQL 2012, Microsoft Visual Studio Shell 2010 as well as Microsoft SQL Server 2012 Report Builder 3.0
I would greatly appreciate your advice on how to accomplish this.
Thanks in advance for your feedback.

Entity Framework and SQL Server datetime

I'm using EF with SQL Server and when I'm fetching a DateTime field that is DateTime on the MSSQL and on EF, I would get something like this:
"UpdateTime":"\/Date(1358716865533+0200)\/"
I have no idea what format is this (only that it shows some time with GMT+2 offset).
Any suggestions?
Second, I've tried to use ToString("") on that fields inside the LINQ that fetches the records and got an error that SQL doesn't support formatting this way - so I have no easy way to format that date as I want.
Is there any way to apply formatting?
Thanks!
As said in the comment, this is a Unix format. You'll get a similar string when you serialize a DateTime with JavaScriptSerializer (JSON).
As for your second question. Yes it can be a nuisance that EF does not allow ToString in linq queries. On the other hand, EF is for data access, formatting is for UI. So you better do the formatting after you've fetched data from the database into memory display them somewhere.

Linked Informix table in MS SQL Server ignoring criteria?

I’m having a problem with a linked Informix table in MS SQL Server 2008r2. When I query this table, it seems to ignore some of the criteria I’m passing to it but not others. For example if I put a condition on the rowdate field the remote query part of the execution plan does not show any WHERE clause but if I put criteria on another field such as ACD it does show.
It seems it does not pass any criteria on the rowdate field but does on all others.
I know the field is indexed on the Informix side. If it helps the table I’m linking is from Avaya CMS and it is linked via the OpenLink ODBC driver.
EDIT:
As far as I know it is Informix Dynamic Server 2000 and it is on Solaris. The column comes up as a DATE data type which is correct. I have tried passing the criteria as ‘2010-08-03 00:00:00’, ‘2010-08-03’, CONVERT(date,’2010-08-03’) and a few more variations. When the data is returned to SQL server it is in the format yyyy-mm-dd.
When I view the execution plan I can see the remote query with all the other criteria followed by a filter for only the rowdate field.
I know that rowdate is indexed and that the driver does normally communicate that information as we use it in other applications (Business objects and MS Access) and they don’t have a problem
I managed to figure it out but it is the strangest thing ever. I went down the route of passing the date in different formats. My default is to use the normal YYYY-MM-DD that of course did not work so I tried YYYY-MMM-DD, still nothing. After going through LOTS of combinations I found one that works Mmm-DD-YY and it has to be exactly that! SEP-21-2010 wont work but Sep-21-2010.
I wonder if this is just a strange hang up from Informix or something in the driver, anyway it works.
On a side note has anyone noticed how strange it is that people from the America write the date month, day year? Stop and think about it for a second, do you say the number 2410 as “Four hundred, ten, two thousand”? The best part about it is try asking yourself this, what day is American independence day? Most Americans say “That’s easy you limey person it is the 4th of July” hmmmm day month (year), the only date they say round the right way is the date they got their independence. I will leave it up to the SO community to see the irony in that
Example query below:
select *
from OPENQUERY (AVAYA, 'select row_date,starttime,intrvl,acd from root.hagent where
row_date = ''NOV-22-2012'' and acd = 1 and split = 1 and starttime = 1900')
By the way I managed to extract accurate data via both MMM-DD-YYYY and Mmm-DD-YYYY.

Resources