Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFGRID Formatting

Status
Not open for further replies.

PDL

IS-IT--Management
Dec 11, 2000
36
US
Old age perhaps but I thought I remembered seeing a means of formatting a date field in a CFGRID?? Can't seem to make it work! Real tired of seeing ODBC date formats! Any pointers appreciated!
 
Hi PDL

What have you got, and what of it is not working? So we see what your doing wrong, and we can help you.


Charl
 
If you're using SQL Server, you could try something like:
Code:
SELECT CONVERT(char, MyDateField, 107) as TheDate 
FROM MyTable
(returns dates like Oct 10, 2000 and Jan 02, 2000)

or
Code:
SELECT CONVERT(char, MyDateField, 101) as TheDate 
FROM MyTable
(returns dates like 10/10/2000 and 01/02/2000)

in your query.
Hope this helps... DarkMan
 
You can use CF to format your date,

Example code:

DateFormat (#YourDate#, "d mmmm yyyy")

 
uhhhh, actually that wont work! - I must have been tired when I typed that!! :)

Try:

DateFormat (#YourDate#, "d mm yyyy")
 
I think it's

#DateFormat(YourDate,"d mm yyyy")#, but I don't think that'll work in a query driven CFGRID.... DarkMan
 
Got DarkMan's to work nicely.

Using <CFGRIDCOLUMN Name=&quot;Cost&quot; Header=&quot;Cost&quot;>

Where wold one put the DateFormat (#YourDate#, &quot;d mm yyyy&quot;)??

<CFGRIDCOLUMN Name='DateFormat (#cost#, &quot;d mm yyyy&quot;)??' Header=&quot;Cost&quot;>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top