April 27, 2010 at 2:33 am
Hi guys, i have this table in a database, that i deleted one row from the table, and after the delete, anytime i do a search on the table, based on new rows that i insert, they don't get searched, but if i do a search based on the old data before the row delete, it returns the result, what can i do to correct this. i'm using sqlserver 2005.
Thanks
Timotech
April 27, 2010 at 5:15 am
Please check the queries carefully. This should not happen. I have never seen such issue.
April 27, 2010 at 5:28 am
Hi, thanks for your reply, its baffeling me also, this is the query:
SELECT PKID, ISNULL(Location,'') AS Location, ISNULL(BoardNumber,'') AS BoardNumber, ISNULL(FK_BoardSize,'') AS FK_BoardSize, ISNULL(FK_BrandId,'') AS FK_BrandId, ISNULL(FK_BrandADId,'') AS FK_BrandADId, ISNULL(FK_ProductId,'') AS FK_ProductId, ISNULL(FK_QualityId,'') AS FK_QualityId, ISNULL(FK_AdvertizerId,'') AS FK_AdvertizerId, ISNULL(FK_CategoryId,'') AS FK_CategoryId, ISNULL(Amount,'0') AS Amount,
DateCaptured, DateEntered, ISNULL(TimeCaptured,'') AS TimeCaptured, ISNULL(PreparedBy,'') AS PreparedBy, ISNULL(FK_StateId,'') AS FK_StateId, ISNULL(FK_AreaId,'') AS FK_AreaId, ISNULL(FK_ZoneId,'') AS FK_ZoneId, ISNULL(FK_ContractorId,'') AS FK_ContractorId, ISNULL(FK_SpecialFeatureId,'') AS FK_SpecialFeatureId, ISNULL(Position,'') AS Position
FROM dbo.tbl_Outdoor
WHERE (DateEntered = @DateEntered)
if i try it with an older date it brings results, but if i insert data and try it based on today's date, it does not return data.
Thanks
April 27, 2010 at 6:25 am
Just try with below query if you are getting the records
SELECT PKID, ISNULL(Location,'') AS Location, ISNULL(BoardNumber,'') AS BoardNumber, ISNULL(FK_BoardSize,'') AS FK_BoardSize, ISNULL(FK_BrandId,'') AS FK_BrandId, ISNULL(FK_BrandADId,'') AS FK_BrandADId, ISNULL(FK_ProductId,'') AS FK_ProductId, ISNULL(FK_QualityId,'') AS FK_QualityId, ISNULL(FK_AdvertizerId,'') AS FK_AdvertizerId, ISNULL(FK_CategoryId,'') AS FK_CategoryId, ISNULL(Amount,'0') AS Amount,
DateCaptured, DateEntered, ISNULL(TimeCaptured,'') AS TimeCaptured, ISNULL(PreparedBy,'') AS PreparedBy, ISNULL(FK_StateId,'') AS FK_StateId, ISNULL(FK_AreaId,'') AS FK_AreaId, ISNULL(FK_ZoneId,'') AS FK_ZoneId, ISNULL(FK_ContractorId,'') AS FK_ContractorId, ISNULL(FK_SpecialFeatureId,'') AS FK_SpecialFeatureId, ISNULL(Position,'') AS Position
FROM dbo.tbl_Outdoor
WHERE (DateEntered <= getdate())
April 28, 2010 at 1:45 am
Hi Vidya, thanks for your post, the query works fine, i also tried it with <= (a specified date) and it also brings result, but when i try it with = (a recent date) then it does not return result.
I just discovered something, anytime i insert from my application, and i search, the query does not return a result, but anytime i manually insert data into the table, then it returns data.
What could be the cause of that?
Timotech
April 28, 2010 at 3:46 am
Hi, I tried to recreate the table and then saved from my application into the table, which succeeded, but when i try to search again, it did not return any result, could it be my application saving something else in the table or what?
Timotech
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply