Showing posts with label havea. Show all posts
Showing posts with label havea. Show all posts

Friday, March 9, 2012

Problem with DTS reading from spreadsheet

Has anyone encountered an issue with blank cells when DTS tries to read
a range from a spreadsheet using a SELECT * FROM [Sheetname$] query? I have
a spreadsheet where I read a range, and some of the cells show up as blank
even though there are values in them. If I alter the cell and resave the
sheet, it works fine. I suppose this could be worksheet corruption, but I
wanted to see if there were any other ideas about what to do. Thanks.

*************************************************
Andy S.
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
*************************************************
Are you seeing this?
Excel Inserts Null Values
(http://www.sqldts.com/default.aspx?254)
Allan
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:#5c#mlL5FHA.472@.TK2MSFTNGP15.phx.gbl:

> Has anyone encountered an issue with blank cells when DTS tries to read
> a range from a spreadsheet using a SELECT * FROM [Sheetname$] query? I
> have
> a spreadsheet where I read a range, and some of the cells show up as
> blank
> even though there are values in them. If I alter the cell and resave
> the
> sheet, it works fine. I suppose this could be worksheet corruption, but
> I
> wanted to see if there were any other ideas about what to do. Thanks.
>
> --
> *************************************************
> Andy S.
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> *************************************************
|||Yes, thank you! It is amazing. This was driving me nuts. Excel will read
in the character data, the character mixed with number data, and ignore the
number data.
Your website is one of the best SQL sites out there. The looping example
alone was a lifesaver.
"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message
news:uEUNVTM5FHA.3496@.TK2MSFTNGP10.phx.gbl...
> Are you seeing this?
> Excel Inserts Null Values
> (http://www.sqldts.com/default.aspx?254)
>
> Allan
> "Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
> news:#5c#mlL5FHA.472@.TK2MSFTNGP15.phx.gbl:
>

Problem with DTS reading from spreadsheet

Has anyone encountered an issue with blank cells when DTS tries to read
a range from a spreadsheet using a SELECT * FROM [Sheetname$] query? I have
a spreadsheet where I read a range, and some of the cells show up as blank
even though there are values in them. If I alter the cell and resave the
sheet, it works fine. I suppose this could be worksheet corruption, but I
wanted to see if there were any other ideas about what to do. Thanks.

*************************************************
Andy S.
andymcdba1@.noreply.yahoo.com
Please remove "noreply" before replying.
*************************************************
Are you seeing this?
Excel Inserts Null Values
(http://www.sqldts.com/default.aspx?254)
Allan
"Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
news:#5c#mlL5FHA.472@.TK2MSFTNGP15.phx.gbl:

> Has anyone encountered an issue with blank cells when DTS tries to read
> a range from a spreadsheet using a SELECT * FROM [Sheetname$] query? I
> have
> a spreadsheet where I read a range, and some of the cells show up as
> blank
> even though there are values in them. If I alter the cell and resave
> the
> sheet, it works fine. I suppose this could be worksheet corruption, but
> I
> wanted to see if there were any other ideas about what to do. Thanks.
>
> --
> *************************************************
> Andy S.
> andymcdba1@.noreply.yahoo.com
> Please remove "noreply" before replying.
> *************************************************
|||Yes, thank you! It is amazing. This was driving me nuts. Excel will read
in the character data, the character mixed with number data, and ignore the
number data.
Your website is one of the best SQL sites out there. The looping example
alone was a lifesaver.
"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message
news:uEUNVTM5FHA.3496@.TK2MSFTNGP10.phx.gbl...
> Are you seeing this?
> Excel Inserts Null Values
> (http://www.sqldts.com/default.aspx?254)
>
> Allan
> "Andy S." <andymcdba1@.noreply.yahoo.com> wrote in message
> news:#5c#mlL5FHA.472@.TK2MSFTNGP15.phx.gbl:
>

Monday, February 20, 2012

Problem with Date logic

Hi OK, Here goes.
I have a booking table with a Checked In Date and a Checked Out Day. I have
a user input screen where a user Chooses a checked in date and checked out
date. I want to know if any rooms are available so I check against the
booking table. I've tried a between date but I have two dates going into th
e
Query and comparing it against the booking table which also has two dates.
Here is the stored procedure that works but only if I pass one date.
ALTER PROCEDURE dbo.Checkbookings
@.CheckIn datetime
AS
Insert Into booktbl select Book.ibook_site from tbl_booking as book
where @.Checkin between book.ibook_in_date and book.ibook_out_date
Select * from tbl_site where not exists(Select * from booktbl where
tbl_site.site_id = booktbl.ibook_site)
I'm trying not to loop in code through the time period the user has placed.
I would like to do the work on the SQL Server.
Any Help at all would be greatly appreciated.Vear
Please post DDL+ Sample data ?
Actually you can use
IF EXISTS (SELECT * FROM Booking WHERE dt>=@.date_in AND dt<
DATEADD(day,1,@.date_out)
Do something here
ELSE
Probably INSERT coomand
"Vear" <Vear@.discussions.microsoft.com> wrote in message
news:08FA718C-8B53-4E7C-977A-F2FFDCEBE01E@.microsoft.com...
> Hi OK, Here goes.
> I have a booking table with a Checked In Date and a Checked Out Day. I
> have
> a user input screen where a user Chooses a checked in date and checked out
> date. I want to know if any rooms are available so I check against the
> booking table. I've tried a between date but I have two dates going into
> the
> Query and comparing it against the booking table which also has two dates.
>
> Here is the stored procedure that works but only if I pass one date.
> ALTER PROCEDURE dbo.Checkbookings
> @.CheckIn datetime
> AS
> Insert Into booktbl select Book.ibook_site from tbl_booking as book
> where @.Checkin between book.ibook_in_date and book.ibook_out_date
> Select * from tbl_site where not exists(Select * from booktbl where
> tbl_site.site_id = booktbl.ibook_site)
> I'm trying not to loop in code through the time period the user has
> placed.
> I would like to do the work on the SQL Server.
> Any Help at all would be greatly appreciated.|||On Thu, 16 Mar 2006 18:47:28 -0800, Vear wrote:

>Hi OK, Here goes.
>I have a booking table with a Checked In Date and a Checked Out Day. I have
>a user input screen where a user Chooses a checked in date and checked out
>date. I want to know if any rooms are available so I check against the
>booking table. I've tried a between date but I have two dates going into t
he
>Query and comparing it against the booking table which also has two dates.
(snip)
Hi Vear,
You didn't post CREATE TABLE and INSERT statements to show how your
tables and data look like, so I'll have to make some assumptions. If you
have a fairly standard design for a reservations database, a query to
find rooms that are available in a give period would roughly look like
this:
SELECT r.RoomNo
FROM Rooms AS r
WHERE NOT EXISTS
(SELECT *
FROM Reservations AS res
WHERE res.RoomNo = r.RoomNo
AND res.EndDate > @.StartDate
AND res.StartDate < @.EndDate)
(Here, @.StartDate and @.EndDate are the period in which the room should
be free, and res.StartDate and res.EndDate are the start and end dates
of existing reservations).
Hugo Kornelis, SQL Server MVP|||Thanks for replying. I used the If Exists and it works great. I rotate
through the dates in the period I'm looking at and send it to a Temp table.
Thanks for your help
"Hugo Kornelis" wrote:

> On Thu, 16 Mar 2006 18:47:28 -0800, Vear wrote:
>
> (snip)
> Hi Vear,
> You didn't post CREATE TABLE and INSERT statements to show how your
> tables and data look like, so I'll have to make some assumptions. If you
> have a fairly standard design for a reservations database, a query to
> find rooms that are available in a give period would roughly look like
> this:
> SELECT r.RoomNo
> FROM Rooms AS r
> WHERE NOT EXISTS
> (SELECT *
> FROM Reservations AS res
> WHERE res.RoomNo = r.RoomNo
> AND res.EndDate > @.StartDate
> AND res.StartDate < @.EndDate)
> (Here, @.StartDate and @.EndDate are the period in which the room should
> be free, and res.StartDate and res.EndDate are the start and end dates
> of existing reservations).
> --
> Hugo Kornelis, SQL Server MVP
>