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!

Formating the Date and Time on a Cheque

Status
Not open for further replies.

nervous2

IS-IT--Management
Feb 24, 2003
125
CA
I have new regulations from the bank in which I need to make for our company.

Firstly the date must be written in

M M D D Y Y Y Y

I chose customize on the date and I am able to add " " to have the date as

MM DD YYYY but I can not get the spaces in between the reset M/D/Y

Also I need format the written amount instead of

FIVE HUNDRED US DOLLARS

I am required to reformat the text to have it margin on the left and asterisks in front of the amount.

Eg

*******************************FIVE HUNDRED DOLLARS

I don't know how to add the "***" is this with the trim command, how woudl I set this to variable whereby the amount of "***" would vary depending on the amount of Text on the cheque.

Thanks for the help.

 
See if this helps,


if {Order_Details.UnitPrice} > 10 and {Order_Details.UnitPrice} < 19 then
"********** "&ToWords ({Order_Details.UnitPrice})
else if {Order_Details.UnitPrice} > 20 and {Order_Details.UnitPrice} < 29 then
"*********** "&ToWords ({Order_Details.UnitPrice})
else if {Order_Details.UnitPrice} > 30 and {Order_Details.UnitPrice} < 39 then
"************ "&ToWords ({Order_Details.UnitPrice})
else if {Order_Details.UnitPrice} > 40 and {Order_Details.UnitPrice} < 49 then
"************* "&ToWords ({Order_Details.UnitPrice})

else "* "&ToWords ({Order_Details.UnitPrice})
 
If you can use a non-proportional font like Courier New, and you can determine the number of characters that can fit on a line, you could use a formula like this (where I'm assuming that 50 characters fit on the line--adjust as necessary):

replicatestring("*",50-len(towords({table.amt}))+towords({table.amt})

-LB

 
Thank you for your suggestions, I my office was closed for a few days therefore I was unable to try this until now.

I changed the font to TT Courier New, therefore the text spacing is uniform.

I am unable to add the extra space between the sates as I do not know how to approach this,

when I edit the current formula for my check text

Originally


UpperCase(ToWords({VPHDFT.pchkamt}))

to

replicatestring("*",50-len(towords({VPHDFT.pchkamt}))+towords({VPHDFT.pchkamt})

I receive an error telling me the ) is missing, if I add the ) to the end then I get a another error stating a number currency or date is required.

When I tried the other suggestion


if {VPHDFT.pchkamt} > 10 and {VPHDFT.pchkamt} < 19 then
"********** "&ToWords ({VPHDFT.pchkamt})
else if {VPHDFT.pchkamt} > 20 and {VPHDFT.pchkamt} < 29 then
"*********** "&ToWords ({VPHDFT.pchkamt})
else if {VPHDFT.pchkamt} > 30 and {VPHDFT.pchkamt} < 39 then
"************ "&ToWords ({VPHDFT.pchkamt})
else if {VPHDFT.pchkamt} > 40 and {VPHDFT.pchkamt} < 49 then
"************* "&ToWords ({VPHDFT.pchkamt})

I did not recieve any errors but when running the check there was no text displayed.

Thanks for the help if you have any other tips please share them.

 
What does this mean: "unable to add the extra space between the sates"--not sure what you intended by "sates".

The formula was missing a paren after the first section, but I modified it a bit further:

replicatestring("*", 75-len(towords({table.amt})[RED]+" US DOLLARS"))[/red]+ucase(towords({table.amt}))[red]+" US DOLLARS"[/red]

-LB

 
Wow that worked thanks! I had to adjust the 75 and play around with it until it fit the cheque properly, and I removed the + " US DOLLARS" as I didn't require that. Thanks so much for the help the only issue I am now stuck on is the date. Or as I misspelled it in the last post the "sate"

the date must be written in

M M D D Y Y Y Y

I can get it to go

MM DD YYYY but I can't seem to get the spaces in between each number, as these cheques are pre-printed and they need to fit inside the specified area.

Thanks You.



 
Create a formula to replace the date:

stringvar x := totext({table.date},"MMddyyyy");//case matters
stringvar y := "";
numbervar i;
numbervar j := len(x);
for i := 1 to j do(
y := y + x+" " //adjust the number of spaces between the quotes as necessary
);
trim(y)

I would use the Courier New font for this, too, in order to preserve the spaces.

-LB
 
I created the formula whereby the system already adds a

formula =

therefore I copied and pasted your formula after the "=" and the system highlights "stringvar" in the first line and states "a number, currency amount, boolean, date, time date-time, or string is expected here.

If I remove the "formula =" at the very beginning of this, which was automatically generated when I selected create new formula an error pops up stating "a statement is expected here"


I tried adding a date field into the formula then adding your formula after but that didn't work either.


Thank You,

Should I be created a brand new blank formula or customizing a date entry?
 
Use my formula but change the syntax to Crystal syntax in the toolbar. Formula = is Basic syntax.

-LB
 
that worked too, thanks a bunch now I can reformat the checks and these should be ready I really appreciate the help.

I am trying to understand the syntax but as a novice it's difficult for me, if you have any recommendation where i can learn some basic crystal syntax I would be very interested. I purchased a crystal reports book which I thought would be quite detailed but it seems to cover only the basics.


 
You can learn a lot just from reading posts here and from the Help section of CR, which is very good. Ken Hamady has some great formula examples and manuals on his website
-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top