Viewing 15 posts - 1 through 15 (of 42 total)
Don't worry all sorted:
Declare @DOB Datetime
Declare @Today Datetime
Set @DOB = '01 November 1971'
Set @Today = '01 November 2011'
SELECT
CASE WHEN DatePart(Month, @Today) < Datepart(Month,@DOB) THEN (Datediff(Year,@DOB,@Today) - 1)
WHEN DatePart(Month, @Today)...
March 4, 2013 at 2:49 am
Thanks Chris, I have figured it out now:
Declare @From Datetime
Declare @To Datetime
Set @From = '07 Jan 2013'
Set @To = '18 Mar 2013'
SELECT Datediff(Week, dateadd(dd, CASE WHEN datepart(weekday,...
March 1, 2013 at 8:09 am
Hi Kingston
I didn't think of that and I should have, each price is a daily price so if the price for a pitch is £9.00 on the 31/01/2010 and the...
February 21, 2013 at 8:04 am
Hi Kingston
That's has worked thank you so much, I cannot believe it was one line of code.
Thanks again
Wayne
February 21, 2013 at 7:47 am
Booking_SkeyBookingNumberArrivalDateDepartureDateBookingDateCancelledDateBookingValuePitchType_SkeySite_Skey
1B000000012010-01-022010-01-232009-12-26NULLNULL42
PitchValues_SkeyPitchType_SkeyStartDateEndDateValue
442010-01-012010-12-3120.00
1142011-01-012011-12-3121.60
1842012-01-012012-12-3122.70
2542013-01-012013-12-3122.70
February 21, 2013 at 7:16 am
Thanks MM saves a lot of time knowing that.
February 21, 2013 at 6:30 am
Thanks everybody I really do appreciate the help, one question though. When you provide the script/query/code (see I have no idea) is there any other way to copy it without...
February 21, 2013 at 6:13 am
This is what my table looks like:
Booking_SkeyBookingNumberArrivalDateDepartureDateBookingDateCancelledDateBookingValuePitchType_SkeySite_Skey
1B000000012010-01-022010-01-232009-12-26NULLNULL42
2B000000022010-01-022010-01-052009-12-26NULLNULL42
3B000000032010-01-022010-01-052009-12-04NULLNULL42
4B000000042010-01-022010-01-162010-01-02NULLNULL42
5B000000052010-01-022010-01-042009-12-26NULLNULL42
6B000000062010-01-022010-01-292009-12-22NULLNULL42
7B000000072010-01-032010-01-312009-10-05NULLNULL42
8B000000082010-01-032010-01-242010-01-01NULLNULL42
9B000000092010-01-042010-01-242010-01-03NULLNULL42
10B000000102010-01-042010-01-062009-12-28NULLNULL42
I hope that helps.
Thanks
February 21, 2013 at 5:15 am
Hi Dwain,
I didn't mean to offend you, if that's the case I am sorry. My boss helped me with that query, is it not right?
1.35 Million Records of which
30%...
February 21, 2013 at 3:54 am
I was given a simple way of doing this:
UPDATE BOOKINGS
SET DepartureDate =
DATEADD(day,
CASE WHEN Rand(CHECKSUM(NEWID())) BETWEEN 0 and 0.3 THEN 2 ELSE
CASE WHEN Rand(CHECKSUM(NEWID())) BETWEEN 0.3 and...
February 21, 2013 at 3:05 am
Hi Dwain
For some reason that didn't work, but I found another solution.
USE Occupancy
Update t
Set BookingNumber = 'B' + Right ('00000000' + CAST (Seq AS varchar (30)), 8)
FROM (SELECT *,ROW_NUMBER() OVER...
February 21, 2013 at 3:04 am
Thank you for that I will try and get my head around it tomorrow.
February 20, 2013 at 9:23 am
Viewing 15 posts - 1 through 15 (of 42 total)