Link to home
Start Free TrialLog in
Avatar of spudmcc
spudmccFlag for United States of America

asked on

delete using time field

Hi Experts!

I need some basic help that I am just not able to solve myself.  I am so new to SQL that I am sure that I am my own worst enemy.  

We have a large data set that has a number of fields including data time.  This is not a calculated field but rather a "time" field that is populated through an upload of data.  It is not part of date/time but just the time field.  

I want to delete records where the data time is equal to:  19:45:33 and the WHOLEID is equal to 83-SW.  Seems easy enough but I continue to get a boolean error near "time".  I don't know what I am doing wrong but would appreciate the help.  

A
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Show your SQL please.
Avatar of spudmcc

ASKER

SELECT "SalesBUP820A"."PriPub", "SalesBUP820A"."PubDG", "SalesBUP820A"."Draw", "SalesBUP820A"."Returns", "SalesBUP820A"."Sales", "SalesBUP820A"."Sout", "SalesBUP820A"."DayCnt", "SalesBUP820A"."DateID", "SalesBUP820A"."PrimaryID", "SalesBUP820A"."DWBNDS", "SalesBUP820A"."md_Retailer", "SalesBUP820A"."WholesaleID", "SalesBUP820A"."Data Date", "SalesBUP820A"."Data Time"
 FROM   "NYP-RetailDataSQL"."dbo"."SalesBUP820A" "SalesBUP820A"
Is that the SQL that fails with the error?
Avatar of spudmcc

ASKER

Sorry, I told you I am new to SQL so I really need the kindergarden version.

delete from SalesBUP820A
where Data Date='12:11:54' and
WholesaleID='83-SW';

This error message:

Msg 4145, Level 15, State 1, Line 2
An expression of non-boolean type specified in a context where a condition is expected, near 'Date'.
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spudmcc

ASKER

That was the solution.  Thank you so much for your patience, time and sharing your knowledge.  I appreciate your help so very much.  

A