How to query on part of a date column?

2006-07-20 Thread Barry Newton
I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from Capclave2005reg Where Year('Date Paid') = 2004;

Re: How to query on part of a date column?

2006-07-20 Thread Dan Buettner
Barry, I think you've got too many quotes in your SQL - the db is trying to find the year from the string 'date paid'. You want to use it as a column name, so drop the quotes: Select * from Capclave2005reg Where Year(Date Paid) = 2004; If you've really got a space in your column name, try

Re: How to query on part of a date column?

2006-07-20 Thread mos
At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from Capclave2005reg

Re: How to query on part of a date column?

2006-07-20 Thread Martin Jespersen
As long as backticks are used around fieldnames, spaces and/or reserved words are fine, tho it does tend to create more work for the user ;) mos wrote: At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a

Re: How to query on part of a date column?

2006-07-20 Thread mos
At 06:20 PM 7/20/2006, Martin Jespersen wrote: As long as backticks are used around fieldnames, spaces and/or reserved words are fine, tho it does tend to create more work for the user ;) Correct. But how many people want to create more work for themselves? A show of hands please!bg Mike