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

How do I convert a Date to a String?? 1

Status
Not open for further replies.

nord

MIS
Aug 5, 2002
21
0
0
US
I have a date or datetime field in the DB and I want to display spaces in the column if the date doesnt match a certain criteria. So I need to create a formula that will replace the data field which will convert the date to string, and either display the datestring or a blank.

Any solutions?

Doug
 
You may not have to convert it, you mention two different things, one is that you want to display spaces, the other that you want to make it blank, which I take to mean display nothing (not spaces). The net viewing is similar, but exporting is not.

To convert to text:

if {MyTable.MyDate} < currentdate-7 then
totext({MyTable.MyDate})
else
&quot; / / &quot;

If you're just going to display blank, why not just use a conditional suppression?

Right click the field and select Format Field, in the X-2 formula area next to Suppression, place inb the criteria when you wish it to be suppressed.

If you don't want those rows in the report at all, enter the criteria in the record selection criteria.

-k kai@informeddatadecisions.com
 
Thanks synapsevampire, you made my day!

nord
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top