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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Formatting

Status
Not open for further replies.

Monkey820

Technical User
Dec 11, 2003
62
US
Can someone help me format my datetime field to be MM/dd/yyyy? and then to make a parameter for that field that is not datetime, but the same format of MM/dd/yyyy?

I am using CRW 8.5

I tried
ToText( {ILLM_DRT.PROD_DATE},"MM/dd/yyyy" )
and also tried

ToText (date({ILLM_DRT.PROD_DATE}),"MM/dd/yyyy" )

Neither worked

When I use the menu option to "format field", my parameter is still a datetime field.

TIA
Micky
 
Hi,
If the field is actually a DateTime one in the database, using the
ToText( {ILLM_DRT.PROD_DATE},"MM/dd/yyyy" )
should work for the display...
What does not work about that technique?
Create the parameter as a String type and , in your selection formula, use
{ILLM_DRT.PROD_DATE} = Date({?StrParam})

In the prompt for the parameter, specify the format for the entry...





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
When I use
ToText( {ILLM_DRT.PROD_DATE},"MM/dd/yyyy" )

I receive the error
"Too many arguments have been given to this function."


 
Hi,
Can you show the entire formula where you use that function.

What database? What is the DataType defined as in that database?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
When you right click on the object and click on "Format Field"->"DateTime" tab, what field is highlighted in the Style box? If it is showing "System Default Short Format", then change it to "03/01/1999" and click OK

-LW
 
Or you could try putting a space after the comma. Always good practice to include 'white spaces' where they are expected.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Spaces do not make the slightest difference in a function.
 
I'm new to crystal reports I only have directions on how to run the report. I'm trying to run one and it gives me an error dateadd("d,"@daystoadd,numbertodate(AROPNHST_SQL.doc_due_dt)) Can someone please tell me what to do??
 
You should really start a new thread for your problem, but basically, you need to modify your formula so that the first comma is after the second quote, not before it. (i.e. "d",)

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top