I just renamed the fields so it would be more simple to understand. Here is the SQL:
SELECT MEDI_GROUPDATA.GRPNO, Sum(MEDI_HSTTRAN!PRVPMT+MEDI_HSTTRAN!EEPMT) AS [Amount Sold], MEDI_GROUPDATA.NAME, MEDI_GROUPDATA.RENEWLDT
FROM MEDI_GROUPDATA INNER JOIN MEDI_HSTTRAN ON MEDI_GROUPDATA.GRPNO =...
Hi Guys,
Table1 contains the following fields:
Name CompanyID SignUpDate
Joined by CompanyID
Table two contains the following fields:
CompID AmountSold1 AmountSold2 DateSold
I am trying to calculate the amount spent the previous year by quarters based on the SignUpDate.
SELECT...
The problem with that is, each group has a different calender year one group might have a calender that runs June to June or September to September. So I needed a away to look at the amount spent by quarter based on each groups calender year. I am sure that a better way exsists to acheive...
I already have code which works on the format that I am trying to acheive.
Heres the code.
Option Compare Database
Dim cn As ADODB.Connection
Dim rs, rs1, rs2, rsmnth, rsgen As Recordset
Dim Mnth, Yr, Counter, calender As Integer
Dim q1, q2, q3, q4, temp As String
Private Sub...
I am trying to get the amount that each group has spent on a monthly basis but also grouped on the GRPNO. This is how I am currently getting the information below.
SELECT CLAIMS.GRPNO, Sum([CLAIMS]![PRVPMT]+[CLAIMS]![EEPMT]) AS [AMOUNT]
FROM CLAIMS
WHERE (((CLAIMS.PDDT) Between 1-1-2004 And...
The above code is for the original format that I layed in the beginning of the thread. Here is the refence table.
ivalue Mnth
1 Actual Self Fund jan
2 Actual Self Fund feb
3 Actual Self Fund mar
4 Actual Self Fund apr
5 Actual Self Fund may
6 Actual Self Fund jun
7 Actual Self Fund jul
8...
CHECK this code out. Using a month lookup table and this code its working. Some changes need to be made for 2005 and on but WOW!
Option Compare Database
Dim cn As ADODB.Connection
Dim rs, rs1, rs2, rsmnth, rsgen As Recordset
Dim Mnth, Yr, Counter, calender As Integer
Dim q1, q2, q3, q4, temp...
Okay, I think I understand the concept of the statment QUARTER = FLOOR((MONTH(DATECOL)-1)/3)+1 I am trying to apply it now.
I have changed how I am compiling the amount spent by company so it now looks like this.
Company amountspent checkdte renewaldt
ABC 2115.12...
Actually they are not I am pulling them from a check register, I put them into the table in that manner Mistake on my part. The companies have mutiple entries by date in the oracle table. Can you explain the statement above?
Actually, I have compiled this contact table from other Oracle tables and imported them into Access into one table.
The pertanant fields in the table are:
Company
Renewaldt properly formated date/time (1/1/2005 example)
slffundjan04
slffundfeb04
slffundmar04
slffundapr04
slffundmay04...
I am not a VB Coder but am rather familar with the query abilities of Access built in Query Designer.
In my contacts table I have how much each company has spent per month. Each of these companies have renewal dates throughout the year.
I am tring to determine how much each of the companies...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.