|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Find the date
Does anyone knows how to retrieve the first time a record was entered into the system? I thought I could used datefirstentered < datecompleted but it doesn't give me the very first time the record was entered in the system. Any ideas?
|
|
#2
|
||||
|
||||
|
Do you have a field in your database the designates when the record was added?
|
|
#3
|
|||
|
|||
|
yes, I have datecompleted, datefirstentered and datemodified.
Because the way the system is setup, the datefirstentered can be as many times as user works with the record. I'm not sure why it is. For instance, record 1122 has 3 instances of datefirstentered. What I want to return is the very first time the record was entered -> datefirstentered. I hope that answered your question. |
|
#4
|
||||
|
||||
|
try
Code:
SELECT MIN(DateFirstEntered) FROM TableName To get the very first date. |
|
#5
|
|||
|
|||
|
I tried using this but, I have other items in the select list that are not aggregate functions and I received an errors message.
|
|
#6
|
||||
|
||||
|
Post your query statement
|
|
#7
|
|||
|
|||
|
select loanid, datecompleted, min(datefirstentered), datelastmodified,statusdescription
from loan_status inner join loan_main on loan_main.loanrecordid = loan_status.loanrecordid inner join setups_loanstatus on setups_loanstatus.statusid = loan_status.statusid |
|
#8
|
||||
|
||||
|
try this
Code:
SELECT A.LoanID, A.DateCompleted, A.MIN(DateFirstEntered), A.DateLastModified, A.StatusDescription FROM loan_status As A INNER JOIN loan_main As B On (A.loanrecordid = B.loanrecordid) INNER JOIN setups_loanstatus As C On (A.statusid = C.statusid) GROUP BY A.LoanID, A.DateCompleted, A.DateLastModified, A.StatusDescription |
|
#9
|
|||
|
|||
|
thank you. that helped.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Find the date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|