A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with expression for Qtr



 
 
Thread Tools Display Modes
  #1  
Old April 26th, 2010, 11:25 PM posted to microsoft.public.access.queries
AccessKay
external usenet poster
 
Posts: 106
Default Help with expression for Qtr

I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

Month_1: Sum(IIf([TransDate] Between ([Forms]![frmVariance]![txtMo1]) And
DateAdd("m",1,([Forms]![frmVariance]![txtMo1]))-1,[tblTrans_Mstr].[Labor_Cost],0))

Thanks for any help.

  #2  
Old April 26th, 2010, 11:46 PM posted to microsoft.public.access.queries
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Help with expression for Qtr

Just change the interval argument of the DateAdd function from "m" to "q".

Ken Sheridan
Stafford, England

AccessKay wrote:
I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

Month_1: Sum(IIf([TransDate] Between ([Forms]![frmVariance]![txtMo1]) And
DateAdd("m",1,([Forms]![frmVariance]![txtMo1]))-1,[tblTrans_Mstr].[Labor_Cost],0))

Thanks for any help.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201004/1

  #3  
Old April 27th, 2010, 12:15 AM posted to microsoft.public.access.queries
AccessKay via AccessMonster.com
external usenet poster
 
Posts: 22
Default Help with expression for Qtr

I'm having a good Access day today. Thanks Ken! I won't ask how to do the
year


KenSheridan wrote:
Just change the interval argument of the DateAdd function from "m" to "q".

Ken Sheridan
Stafford, England

I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

[quoted text clipped - 3 lines]

Thanks for any help.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201004/1

  #4  
Old April 27th, 2010, 12:18 AM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Help with expression for Qtr

You can not get the Qtr from the [tblTrans_Mstr].[Labor_Cost] as it is not a
date.

Format([TransDate], "q") will give you a number representing the
quarter of the year that [TransDate] falls in.

Explain a little more of what you are trying to achieve.


--
Build a little, test a little.


"AccessKay" wrote:

I’m not very good yet with writing expressions. How would I convert this
expression to get the quarter?

Month_1: Sum(IIf([TransDate] Between ([Forms]![frmVariance]![txtMo1]) And
DateAdd("m",1,([Forms]![frmVariance]![txtMo1]))-1,[tblTrans_Mstr].[Labor_Cost],0))

Thanks for any help.

  #5  
Old April 27th, 2010, 02:23 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Help with expression for Qtr

On Mon, 26 Apr 2010 23:15:07 GMT, "AccessKay via AccessMonster.com"
u59222@uwe wrote:

I'm having a good Access day today. Thanks Ken! I won't ask how to do the
year


It might be prudent: you'll probably use "y" which is the day of the year
rather than the correct but noninuitive "yyyy".
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.