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

Converting to date or String 1

Status
Not open for further replies.

khan82

Technical User
Feb 23, 2012
57
CA
if {Table.Modification_Number} >= 1 then {Table.Orig_Lease_End_Date} + 1
else "N/A"


I created the above formula but I am getting the error that there should be a date field after the else statement...can anyone please advise? Thanks!
 
hi,

Can't have a date (which is a NUMBER) and TEXT in the same field! You might use a low value out-of-bounds date to indicate the else condition value, like 1900/01/01 for instance.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
so basically i want to check if a certain record is greater than 0 and if it is then i want to print the date from the same table otherwise "N/A"

how can i achieve this?
 
Try:

Code:
if {Table.Modification_Number} >= 1 then ToText({Table.Orig_Lease_End_Date} + 1, "dd/MM/yyyy")
else "N/A"

You can change the "dd/MM/yyyy" part to format the date the way you want it.
Cheers
Pete
 
the only problem with that dd/mm/yyyy format will be the collating sequence, if that matters.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Sweeet that worked.....i dont really know what collating sequences will be like...but i will look at it when i encounter a problem....

while i have your attention...could you help me with another formula?

this is basically for record selection. I want crystal to only show leases that have a charge effective date of a certain charge = parameter date.

so for example a lease has three charges...i want crystal to look at the charge type "Rent" and display leases that have the rent charge with an effective date of 11/01/2013(entered through parameter)

i have the report grouped by charge types and the following group selection formula

{Table.Effective_Date}=maximum({Table.Effective_Date},{Table.Charge_Type})
 
Sorry Khan82, I don't understand what you are now trying to do.

Firstly, if it is not related to the original issue you should really start a new thread. Secondly, I think you will find you get more help if you spend a bit of time explaining. Some sample data, details of the results you are getting and the results you want helps to improve the level of understanding of those who want to help.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top