Results 1 to 2 of 2

Thread: SQL to Coldfusion

  1. #1
    Join Date
    Dec 2010
    Location
    Charlotte
    Posts
    1

    Default SQL to Coldfusion

    Hello Everyone,

    I'm trying to write this statement using coldfusion:

    Select * from TableName where ColumnName >= 1/1/2005 and ColumnName < '1/1/2006'

    In my database is a column, set to "Float" names year. All it has is a 4 digit year. I'm trying to build a dropdown with only certain years listed.

    Thanks Everyone!
    Aaron

  2. #2
    Join Date
    Aug 2009
    Posts
    58

    Default

    Aaron,

    You can use code similar to what is below

    <CFQUERY NAME="YourQueryName" DATASOURCE="YourDSNName">
    SELECT * FROM TableNAme
    </CFQUERY>

    <FORM METHOD="POST" ACTION="CFPage.cfm">
    <SELECT NAME="Name">
    <OPTION>Select an item</OPTION>
    <CFOUTPUT QUERY="list">
    <OPTION VALUE="#YourInformation#">#YourInformation#</OPTION>
    </CFOUTPUT>
    </SELECT>
    <INPUT TYPE="submit" VALUE="Submit Fruit">
    </FORM>

    If you have any further questions regarding this or need additional support please submit a ticket at "support.hostek.com".

Tags for this Thread

Posting Permissions

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