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

Could someone tell me...

Status
Not open for further replies.

bigdad

Programmer
Jul 17, 2001
34
VE
I`ve a new problem but this time is with a especific date.

I need know how can I convert a date in character. for Example: (06/21/2001) to ("06/21/01")

If someone can helpme thanks you...

Bigdad
 
Hmm...by some twist of fate, I wonder if you're asking how to automatically drop the century portion of the date field.

To convert a string "06/21/2001" to "06/21/01", try this:
Code:
SET CENTURY OFF
cShortDate=DTOC(CTOD("06/21/2001"))
The CTOD function converts the string to a DATE field. The DTOC function converts that DATE field back to a CHARACTER field using the current CENTURY setting (in this case, OFF).

Dunno if that was what you were asking, but hey...it couldn't hurt. :eek:)
 
thank`s but nothing. I`m trying to use that with the DynamicForecolor. I don`t know how I can`t use that one in case that a date of my table is empty. The DynamicForecolor as DynamicBackcolor use IIF + a expression to evalue. Here is an example:

thisform.grdtotales.SetAll("DynamicBackColor", "IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255), RGB(0,255,0))", "Column") && this take turns the records between white and green.

When "IIF(MOD(RECNO( ), 2)=0" is the expression to evalue to take turns the records between white and green.

My point is how Can I do to use a expression just like that in case of some records date of a especif table are empty

thank`s all of you
bigdad
 
This has to work ...

thisform.grdtotales.SetAll("DynamicBackColor", "IIF(empty(datefield), RGB(255,255,255), RGB(0,255,0))", "Column")

where datefield is the name of the field you are testing.

Don
dond@csrinc.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top