Viewing 15 posts - 1 through 15 (of 27 total)
Provider=SQLNCLI11.1;Integrated Security="";Persist Security Info=False;User ID=sa;Initial Catalog=MYDATABASE;Data Source=MY-PC;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MY-PC;Initial File Name="";Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False;Application Intent=READWRITE;
March 19, 2012 at 8:05 am
In hotel stay,the day of departure is the next day.
so if you enter 26.6 till 27.6 that is one day stay.
June 27, 2011 at 11:56 am
jeff,thanks a lot...
Did not have the time to check this but it seems the last output is wrong
DBLMS 2011-04-25 00:00:00.000 2011-04-26 00:00:00.000 118.00 ...
June 27, 2011 at 11:38 am
"Result matches with what you want. You need to change dates & "<" / ">" signs according to your requirements."
this is the hard part ....i cant seem to make this...
June 26, 2011 at 7:58 pm
Changed :
else RATE_START_DATE
end,
case when rate_start_date > '2011-04-14'
then '2011-04-20'
else RATE_END_DATE
end
but how do I get column names ???
June 26, 2011 at 10:37 am
I did a quickie and this is what I get :
room_type(No column name)(No column name)ratedays
DBLMS2011-04-14 00:00:00.0002011-04-16 00:00:00.000104,00-101
DBLMS2011-04-16 00:00:00.0002011-04-20 00:00:00.000122,00-5
????
June 26, 2011 at 9:02 am
This seems to produce the right results:
SELECT
room_type,rate_start_date,rate_end_date,rate
, DATEDIFF(DAY,case when rate_end_date < '2011-04-20'
...
June 24, 2011 at 7:07 pm
when I run this :
SELECT
room_type,rate_start_date,rate_end_date,rate
, DATEDIFF(DAY,case when rate_end_date > '2011-04-14'
...
June 24, 2011 at 6:04 pm
You're right (it's from mysql)
I tried your version but get :
Msg 174, Level 15, State 1, Line 3
The datediff function requires 3 argument(s).
June 24, 2011 at 5:18 pm
Here is all the data :
http://www.sqlservercentral.com/Forums/Topic1131513-1292-1.aspx
Posted a new question...
June 24, 2011 at 4:48 pm
Thank you all ...
But ...since everything seems to be going well, I have obviously overlooked something.....
😛
June 23, 2011 at 12:52 am
so basically I need this :
SET DATEFORMAT DMY
before every insert queery.
I dont really care how the server stores my data as long as I enter it
correctly....
I tried and it...
June 22, 2011 at 10:35 am
Convert thing just converts data view - it leaves field intact.
Converts data (date type) to string.
This is done just to view data.
However,the data (datetime) itself unless in the crazy format...
June 22, 2011 at 6:35 am
Viewing 15 posts - 1 through 15 (of 27 total)