Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Dear friends

I need to order EPF Numbers according to the today date. where is the wrong

My Table Name BreakFast

ID int
EPF_Number varchar(50)
COUNT int
DATE date
TIME time(7)



SQL
SELECT DATE=CONVERT(DATE, GETDATE())  FROM BreakFast where EPF_Number 


error
An expression of non-boolean type specified in a context where a condition is expected, near 'EPF_Number'.''
Posted

Say it aloud for yourself in English...
'Please select me the date from the table BreakFast where EPF_Number'...
Where EPF_Number, what?
Where clause is incomplete as there is no actual condition in it...
In any other aspect too you query is wrong - check CONVERT function[^] of SQL to see what parameters it gets...
You also mentioned a need for order, but no ORDER BY clause in your query of any kind...

(If I try to make any sense of your request, you should have some query like this:
SELECT EPF_NUMBER FROM BREAKFAST ORDER BY DATE)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 21-Jun-15 20:57pm    
It's quite logical, a 5. :-)
—SA
Missing values in where clause
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900