How to calculate two value between different date and different reco

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4

49 Replies - 3593 Views - Last Post: 14 January 2011 - 05:28 PM Rate Topic: -----

#46 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 282
  • View blog
  • Posts: 1,489
  • Joined: 07-April 08

Re: How to calculate two value between different date and different reco

Posted 14 January 2011 - 11:48 AM

as i don't have your database i'm unable to test this code, but try it and see if it gives you what your looking for.

SELECT	ID
		,DateShift1
		,H2ExPSATotal
		,(
			SELECT	Sum(H2ExPSATotal) As Total 
			FROM H2ExPSASummary 
			WHERE H2ExPSASummary.DateShift1 <=T1.DateShift1
					AND MONTH(H2ExPSASummary.DateShift1) = MONTH(T1.DateShift1)
		 ) AS Total
FROM H2ExPSASummary AS T1


Was This Post Helpful? 1
  • +
  • -

#47 mnazera  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 03-January 11

Re: How to calculate two value between different date and different reco

Posted 14 January 2011 - 12:35 PM

View Postrgfirefly24, on 14 January 2011 - 05:48 PM, said:

as i don't have your database i'm unable to test this code, but try it and see if it gives you what your looking for.

SELECT	ID
		,DateShift1
		,H2ExPSATotal
		,(
			SELECT	Sum(H2ExPSATotal) As Total 
			FROM H2ExPSASummary 
			WHERE H2ExPSASummary.DateShift1 <=T1.DateShift1
					AND MONTH(H2ExPSASummary.DateShift1) = MONTH(T1.DateShift1)
		 ) AS Total
FROM H2ExPSASummary AS T1





Thank, I was tried this code (add 1 criteria in INNER SELECT), but why the Access ask Enter Parameter Value for "H2ExPSASummary.DateShift1" ? What wrong with "H2ExPSASummary.DateShift1" ?
I think in first criteria in INNER SELECT, "H2ExPSASummary.DateShift1 <=T1.DateShift1", it no problem which mean the access was know with it's value, why in second criteria the access not know this value ? So when I tried pass this value, of course in the Total column no result (empty)

Thank
Was This Post Helpful? 0
  • +
  • -

#48 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 282
  • View blog
  • Posts: 1,489
  • Joined: 07-April 08

Re: How to calculate two value between different date and different reco

Posted 14 January 2011 - 02:43 PM

i'm not sure, let me see your implimentation of the code and i'll be able to tell further
Was This Post Helpful? 1
  • +
  • -

#49 mnazera  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 03-January 11

Re: How to calculate two value between different date and different reco

Posted 14 January 2011 - 04:57 PM

View Postrgfirefly24, on 14 January 2011 - 08:43 PM, said:

i'm not sure, let me see your implimentation of the code and i'll be able to tell further



Yes, I make miss error in parentheses.
It was worked properly
Thank you very much for you rgfirefly24 and Ionut and other reader

Again, special for rgfirefly24 for your response and solution,thank , I was learned much from you and I hope you still help me on next time in other case
Was This Post Helpful? 0
  • +
  • -

#50 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 282
  • View blog
  • Posts: 1,489
  • Joined: 07-April 08

Re: How to calculate two value between different date and different reco

Posted 14 January 2011 - 05:28 PM

No problem. We are here to help.
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4