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

Whoa... All I need to do is return a variable???

Status
Not open for further replies.

VoodooRage

Programmer
Oct 9, 2002
43
US
I have a crosstab query that does this:
Expr1: "PD" & Weekday([Date])

this allow the column headers to be "PD1", "PD2" and so forth.

I need to write a function that does the same thing but I have a separate table to determine the period?

How can I return a variable like the weekday function???

I am trying Expr1: "PD" & DetPD([Date])

Where:

DetPD(dte as Date) 'Is the function being called? The function calls fine and does its job but I just need to retrun the period as calculated in the function similar to the weekday funciton.

As Always Thanks so much.
 
Hallo,

Not sure exactly what you're after. Maybe I'm being slow...

Is this what you want to know?
Code:
Function DetPD(dte As Date) As Integer
  DetPD = whatever
End Function

Or did you want te code for the DetPD function?

- Frink

PS. You'll have to excuse me being fussy, but if the function is to determine the period, then why not call the routine DeterminePeriod? or better intDeterminePeriod, as it returns an integer
Happy programming :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top