PDA

View Full Version : SQL to Coldfusion



mossman65
December 20th, 2010, 07:48 AM
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

chrisd
December 20th, 2010, 08:18 AM
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".