Forums
This topic is locked
order by date
Posted 24 Mar 2003 11:41:51
1
has voted
24 Mar 2003 11:41:51 Wayne Hultum posted:
I have produced a calendar of events. Using a form I input the data in to my DB.What I want to do is display the result as a list in date order by month, when I try arranging by date it puts August first. I want the results to be displayed in month order, Jan, Feb, March etc.
Can anyone suggest something…
Thanks in advance
Wayne
Replies
Replied 24 Mar 2003 13:01:23
24 Mar 2003 13:01:23 Julio Taylor replied:
what data type are you using for your date field? it seems as though you are using a text field for your month, and the script is ordering your records alphabetically instead of chronologically. ensure that you use a date field of some type.
-- J
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
-- J
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
Replied 24 Mar 2003 13:56:42
24 Mar 2003 13:56:42 Wayne Hultum replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
what data type are you using for your date field? it seems as though you are using a text field for your month, and the script is ordering your records alphabetically instead of chronologically. ensure that you use a date field of some type.
-- J
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I had a look at the DB and was using a test field. I changed it to date and it works now.
Do you know how to dispaly the date as a long date on the page instead of 29/03/2003?
thanks
what data type are you using for your date field? it seems as though you are using a text field for your month, and the script is ordering your records alphabetically instead of chronologically. ensure that you use a date field of some type.
-- J
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I had a look at the DB and was using a test field. I changed it to date and it works now.
Do you know how to dispaly the date as a long date on the page instead of 29/03/2003?
thanks
Replied 24 Mar 2003 17:26:39
24 Mar 2003 17:26:39 Julio Taylor replied:
you can use the date_format() function. i have used this with MySQL, i'm not sure what server tech you're using. in mysql, you can do something like date_format(fieldname,'%D %M %Y')
this will return something like '12 January 2003'
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
this will return something like '12 January 2003'
------------------------
Julio
PHP | MySQL | DWMX | ColdFusion
ICQ: 19735247
Replied 24 Mar 2003 22:36:12
24 Mar 2003 22:36:12 Dennis van Galen replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
you can use the date_format() function. i have used this with MySQL, i'm not sure what server tech you're using. in mysql, you can do something like date_format(fieldname,'%D %M %Y')
this will return something like '12 January 2003'
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Did someone mention dates ?
www.dmxzone.com/myZone.asp?userid=10300
for access/sql server it is dateformat(datefield, "d, mmm, yyyy"
with kind regards,
Dennis van Galen
DMXzone Manager
FAQ, Tutorial and Extension Manager
Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5
you can use the date_format() function. i have used this with MySQL, i'm not sure what server tech you're using. in mysql, you can do something like date_format(fieldname,'%D %M %Y')
this will return something like '12 January 2003'
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Did someone mention dates ?
www.dmxzone.com/myZone.asp?userid=10300
for access/sql server it is dateformat(datefield, "d, mmm, yyyy"

with kind regards,
Dennis van Galen
DMXzone Manager
FAQ, Tutorial and Extension Manager
Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5