CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Search for year in datetime field

Print topic Send  topic

Author Message
headhunter


Posts: 130
Posted: 03/05/2005, 2:27 AM

I can't get it to work:

I have records with a datetime field signup_datetime in db in format yyyy-mm-dd HH:nn:ss

I have a search parameter s_signup_year

Then I use these settings in my editable grid ds parameter settings:
Name: signup_datetime
Type: date
Format: yyyy-mm-dd HH:nn:ss

Condition: equals (=)
Under parameter source:
Parameter: s_signup_year
Type: url
and format yyyy

I have tried also different other approaches but none of them work.
What am I doing wrong?

Thanks in advance
View profile  Send private message
peterr


Posts: 5971
Posted: 03/05/2005, 4:02 PM

This probably would result in such SQL query:
"... WHERE signup_datetime = 2005"
Thus it cannot work if your signup_datetime filed doesn't contain only the year.

I recommend that you work your way backwards and first create an SQL that works for you in the database, then use it in CCS. You may need to use some SQL date conversion function or date range.
Possibly someone else has an example handy.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
headhunter


Posts: 130
Posted: 03/06/2005, 2:18 PM

Solved it myself:

Query should be "... WHERE YEAR(signup_datetime) = '2005'
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.