Hot Topic (More than 10 Replies) searching this Quarter (Read 1508 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
searching this Quarter
Sep 16th, 2010 at 10:34am
Print Post Print Post  
Hallo!

to search for this Quarter my Code is :vQtr = @Int(((@Month(Eingang -1) / 3)) + 1)
but i get the wrong Quarter-number 4 ?

Thank you for the help.


  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: searching this Quarter
Reply #1 - Sep 16th, 2010 at 1:12pm
Print Post Print Post  
You only want to add 1 if there is a remainder after dividing by 3.
Code
Select All
var vQtr as Int

	vQtr = @Int(@Month(Eingang - 1) / 3)
	If @Mod(@Month(Eingang - 1), 3) > 0
	{
		vQtr = vQtr + 1
	}
 


  

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: searching this Quarter
Reply #2 - Sep 16th, 2010 at 1:49pm
Print Post Print Post  
This also will work:

vQtr = @Int((@Month(Eingang) / (12/4)) + 0.75)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: searching this Quarter
Reply #3 - Sep 16th, 2010 at 1:52pm
Print Post Print Post  
Hello Erika!
This code works beautifully, thank you very much!

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: searching this Quarter
Reply #4 - Sep 16th, 2010 at 2:03pm
Print Post Print Post  
Please, how can i use it as a retrieve:

{ @Int((@Month(Eingang) / (12/4)) + 0.75)  }
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: searching this Quarter
Reply #5 - Sep 16th, 2010 at 2:26pm
Print Post Print Post  
Hi Amor,

I see the Excel formula I think you are trying to copy and the problem is that you have some parenthesis out of place.
Try this adjustment to your original formula:

vQtr = @Int((@Month(Eingang) - 1) / 3) + 1
  

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


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: searching this Quarter
Reply #6 - Sep 16th, 2010 at 3:56pm
Print Post Print Post  
Erika,
i donīt use  Excel formula , I just want to use the Formel in Sesame search Modus.
i would extract the records of the current quarter.

thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: searching this Quarter
Reply #7 - Sep 16th, 2010 at 4:34pm
Print Post Print Post  
Yes. Try the code above.
  

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


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: searching this Quarter
Reply #8 - Sep 16th, 2010 at 7:41pm
Print Post Print Post  
Erika,

Do you mean this Code in search Modus and in field Datum ?
{Datum = @Int((@Month(datum) - 1) / 3) + 1  } 

It doesīt work.

thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: searching this Quarter
Reply #9 - Sep 16th, 2010 at 7:52pm
Print Post Print Post  
Quote:
Erika,

Do you mean this Code in search Modus and in field Datum ?
{Datum = @Int((@Month(datum) - 1) / 3) + 1  }  

It doesīt work.

thanks.


No, if you're looking for quarter 4, you want something like the following in any field:
{@Int((@Month(datum) - 1) / 3) + 1 = 4}  
  

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


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: searching this Quarter
Reply #10 - Sep 16th, 2010 at 8:59pm
Print Post Print Post  
Erika,
thank you so much.

Dr.Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged