Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Splitting the Date Field

    One of the pages of my site that I am developing a user types in for example 1992 in the textbox with a name "data_entryYear", When I click on the submit button, I want the database to search for all entries of 1992 from the database. The format of the date field in my database is yyyy-mm-dd

    Thanks in advance for any help

    Boz

  • #2
    New to the CF scene
    Join Date
    Dec 2008
    Location
    Alpharetta, GA, US
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I assume that you have MySQL database manager. In that case try to use MySQL function "YEAR".

    SELECT * from Your_table_name WHERE YEAR(DATE_type_field_name) = $variable_representing_year;

    I have not tested this.

  • #3
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gracias tanto


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •