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

Parameter field from a furmula field ?

Status
Not open for further replies.

ejo

Technical User
Apr 5, 2001
5
NO
I got a database that have h field named "Lastedato". This is a date, but it is stored as number in the database. I'm using this formula make a furmula field also called "Lastedato":

local stringvar ds;
local numbervar aar;
local numbervar mnd;
local numbervar dag;

ds := totext ({OrdreHode.LasteDato},0,"","");
aar := val(left(ds,4));
mnd := val(mid(ds,5,2));
dag := val(right(ds,2));
date(aar,mnd,dag)

What I need to do is to select all orders for a peried based on "Lastedato". Everey month got 2 periods 1-15 and 16-end of month. Can I use a parameter field based on the furmula field or is it any other way I can get this to work?
I also need to compere this to the same period last year.
I trayd to use month to date, but I get problems with the seccond period of the month.

Tanks and Regards
Espen
 
To get your monthly split, you can use a formula like the following.

if day({@Lastedato}) in [1 to 15] then "Period 1" else "Period 2"

Mike

 
there is a numbertodate UFL on the crystal decisions website. It converts an 8 digit integer in YYYYMMDD format to a true date. I use it all the time as Macola stores their dates this way. Maybe that will help. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top