Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello ,
In short, I am trying to develop a BI application using the tool SQL SERVER 2012 .
The everything went well and properly.
I described my problem:
The BI application is developed for an industrial company . The work is on 3 Part times ( Morning , Afternoon , Night ) .
The dates in the table "Date" are integers (for EXP ' 2015-07-22 ' will be 20,150,722 ) for performance reasons ( Loading data ... )
Also the hours are converted in enteger ( for example : id = 1 returns to time : 0h-1h , who is on Night post) .

==> Morning 06h to 14h
==> Afternoon 14hh to 22h
==> Night from 22h to 06h

The problem is how to calculate such a measure in the Night post.
The answer is clear : SUM of two dates, the first from 22h to 00h
and the second from 01h to 06 h . but how ???????
In SSAS , you can not filter twice.
Please I need help.
Thank You
Posted

1 solution

I really suggest dropping the idea of using integers instead of datetime. That kind of logic will make it very difficult to manipulate and query the data.

What comes to performance, SQL Server handles dates internally using numbers so the difference between integer and date shouldn't be meaningful.
 
Share this answer
 
Comments
Member 11603655 22-Jul-15 7:39am    
What about making a querry MDX which join the two select ????
Wendelius 22-Jul-15 10:05am    
This could probably be done but why create a workaround for a problem which is caused by doing things in non-standard way?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900