Click here to Skip to main content
15,887,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my shopping cart project, I intend to select a particular row that falls into certain
conditions. In the table I have columns namely CategoryId,ProductId,Season,SeasonFromMonthNumber
(value is 1) and SeasonToMonthNumber(value is 12).
Now, using the current month number(6), I tested with the following code. The result is nothing.
Can anyone give me the correct code.

SELECT season from product WHERE CategoryId=4 and ProductId=72 and SeasonFromMonthNumber>=6 and SeasonToMonthNumber<=6;
Posted
Comments
OriginalGriff 10-Jun-14 2:05am    
And?
What does your query do that you didn't expect, or not do that you did?
What help do you need?
S.Rajendran from Coimbatore 10-Jun-14 2:12am    
I want the query to show the value in the column 'season' which is 'jul-dec'. But my above query shows just the column name 'season' without the value contained in it, that is 'jul-season'.
S.Rajendran from Coimbatore 10-Jun-14 2:20am    
In fact, I want to get those rows that has values greater than or equal to 6 in column 'SeasonFromMonthNumber' and less than or equal to 6 in column name 'SeasonToMonthNumber'.
OriginalGriff 10-Jun-14 2:33am    
And that is what you query does!
So, either you are explaining this badly, or we need to see sample data, with what you expect to get (and what you do get).


Remember that we can't see your screen, access your HDD, or read your mind - all we get to work with is what you tell us!

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