Normal Topic Month name in Q&A 5 report header? (Read 1898 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Month name in Q&A 5 report header?
Mar 29th, 2007 at 6:56pm
Print Post Print Post  
Does anyone know of a way to get the name of the current month in the header of a Q&A 5.0 report?

I have tried:

@MONTH(@DATE) - this produces @MONTH(March 29, 2007)
{@MONTH(@DATE)} - this produces {@MONTH(March 29, 2007)}
@MONTH - this produces @MONTH

So I think I'm on the wrong track.  Are just the current date and/or time available for report headers?
  

**
Captain Infinity
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Month name in Q&A 5 report header?
Reply #1 - Mar 29th, 2007 at 8:52pm
Print Post Print Post  
Off the top of my head ........

@month returns a number, so it must be a number field, returns the number of the month.

Want the name?
Add a LU table for 1-12 with Jan-Dec. in columns 1 and 2.

If you do a @LU(@month(@date),1) then you will put the result in a text field.
------------------------

Better answer
@month$(@date) will return the name of the month.

To put this into the header, you need to put the month function formula in an invisible derived column and call the derived column in the header definition.

Say the derived column is number 4, enter this in the header line:
This report was printed in the month of *PG {?4}*
Make sure the derived column has the "I" for invisible.

Note that the "4" actually represents the physical definition that is derived.  So if you have 4 derived columns, and then delete #2, you only have three derived columns now, but the last one looks like it is number 4.  In this instance it should be referenced as "3", vs. "4".
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Month name in Q&A 5 report header?
Reply #2 - Mar 29th, 2007 at 8:56pm
Print Post Print Post  
Report Headers don't run code. @Date is special.

I seem to remember a trick you could do with a report header and an invisible column though. It involved something like creating a derived column set to be invisible that used @Month to get its value. Then you could do something like this in the report header using the column number:
{5} or maybe {#5}

I can't recall exactly. Anyone else remember this?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Month name in Q&A 5 report header?
Reply #3 - Mar 29th, 2007 at 9:10pm
Print Post Print Post  
I got it done Erika.  I was editing my earlier posting when you entered yours.


Never tried this, but this may also work:
*PG { @month$(@date) }*

Edited:   I just tested the line directly above, it does not work.  But the line I submitted with the derived column does work.  But now I can say I have tried it.
« Last Edit: Mar 29th, 2007 at 11:35pm by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Month name in Q&A 5 report header?
Reply #4 - Mar 30th, 2007 at 2:19pm
Print Post Print Post  
Thanks, you folks really come through!
  

**
Captain Infinity
Back to top
IP Logged