Trouble With Dates
Dec 18, 2005
I have a table where I'm recording when I need to follow up with a client. From this table I want to create a query where as the criteria is everything more then 30 days from todays date. I built an expression of Expr1:[date of follow up] - date(). I set the criteria for <30. It gives me everything overdue ( a negative number) and everything going to be due in 30 days or less. However if I take the 30 out and substitute a parameter"[How Many Days]". It only gives me the positive numbers. Why is that and what can I do? I would like to take this query and build a report off of it where as when I open the report i will have to answer that question and it will give me everything overdue plus what will be due.
View Replies
ADVERTISEMENT
May 4, 2006
I have a query which displays information on course dates. I have 2 fields one called Course Start Date and the 2nd called Course End Date. The fields are formatted as dd/mm/yy and are in the same table.
Some courses run for one day only and so have just a Course Start Date with no Course End Date.
I need to display these 2 fields together (example 01/01/06 and 03/01/06 as 01-03 January 2006) so that I can export the resulting records to an excel spreadsheet to email to a client.
I cannot find a format or expression to combine the 2 fields.
Any help????
View 3 Replies
View Related
May 12, 2014
Any way to have a form with Dates as column headers to update a table where the dates are stored in rows???
The table set up is like this:
tblOpHdr
DiaryID (PK) - OpDate (Date)
tblOpDetail
DiaryID (FK) - CostCode - MachineNumber - MachineHours - etc
I'm just wondering if there's any way I can do this with a datasheet or a crosstab type setup?
It's Access 2010.
View 1 Replies
View Related
Aug 28, 2013
I have built a query to calculate the expiry dates of training courses but I am trying to input a criteria so that only dates within 90 days of todays date show. I am using Date()<90 but it doesn't return the correct information. What the criteria should be for this?
View 1 Replies
View Related
Apr 9, 2015
I have a table of records, which has within it two date fields (effectively, a 'start' and 'end' date for that particular record)
I now need to create a query to perform a calculation for each date between the 'start' date and the 'end' date
So the first step (as I see it anyway) is to try to create a query which will give me each date between the two reference dates, in the hope that I can then JOIN that onto another query to perform the necessary calculation for each of the returned dates.
Is there a way to do this?
So basically, if for a particular record, the 'start' date is 01-Apr-2015 and the 'end' date is 09-Apr-2015, can I produce a dataset of 9 records as follows :01-Apr-2015
02-Apr-2015
03-Apr-2015
04-Apr-2015
05-Apr-2015
06-Apr-2015
07-Apr-2015
08-Apr-2015
09-Apr-2015
(The *obvious* solution would be to create a separate table of dates, from which I could just SELECT DISTINCT <Date> Between #04/01/2015# And #04/09/2015# - but that seems like a dreadful waste of space, if that table is only required to generate the above? And it would have to cover all possible options; so it would either have to be massive, and contain every possible date - ever! - or maintained, adding new dates as necessary when they are required. Seems horribly inefficient!)
Is it possible to just select each date between the two reference dates? Or can you only query something which exists somewhere in a table?
View 4 Replies
View Related
Sep 7, 2006
Hiya-
I have a database with 5000 entries, corresponding to about 10 entries for about 500 people. Each of the entries is dated, and I need to calculate the time intervals between each person's sequential entries in the table.
One way of doing this is to create another column that contains the date of the previous entry. I can then use DateDiff to subtract one date from the other and give me the difference in days.
This approach falls down if I then work with only a subset of the entries - I would have to re-enter the previous entry dates as the time intervals would have changed.
What I really need is a way of subtracting the date from the date in the cell directly above it. Will Access let me do this, or is there a better way?
Many thanks, Jules.
View 3 Replies
View Related
Jul 8, 2014
I have two tables with dates. Between (!) every two following dates in table1, I want to know the number of dates in table2. How do I write an SQL query for this? The tables I have are up to a few hundred records in table 1 and a few thousand records in table2. So to prevent that this takes hours I need a fast query.
To explain the query I need, for example:
table1
01/01/2014
15/01/2014
17/01/2014
30/01/2014
table2
01/01/2014
02/01/2014
05/01/2014
17/01/2014
18/01/2014
20/01/2014
21/01/2014
25/01/2014
So the answer of the query would be 2,0,4.
Explanation:
Between 01/01/2014 and 15/01/2014 in table 1 there are 2 dates in table2 (01/01/2014 is not included between the dates)
Between 15/01/2014 and 17/01/2014 in table 1 there are 0 dates in table 2
Between 17/01/2014 and 30/01/2014 in table 1 there are 4 dates in table 2
View 2 Replies
View Related
Nov 15, 2011
I have a master table which shows all transactions per record (person) over a financial year.
Each record person has a seperate package period over which their spend needs to be measured. Therefore although I have all their transactions for the year, I only want to sum their transactions between their given [start date] and [end date] which are in columns.
I need to be able to create a field which sums all expenditure per record between the start and end dates
Name Start Date End Date Invoice Date Amount
Matt 15/5/11 15/9/11 1/11/11 £100
Matt 15/5/11 15/9/11 7/7/11 £200
Matt 15/5/11 15/9/11 12/12/11 £200
In this case I would only want to sum 7/7/11 as this is between the start and end dates
I want to write something like sumif([Invoice Date] is between [start date] and [end date] - not sure where or how exactly
(The start date and end date will always be the same per person)
Is this possible in access?
View 10 Replies
View Related
Jun 20, 2005
Hello. Recently posted for advice on building an access database on health service training. I had a lot of help but I suppose I haven't really grasped relationships yet. My database looks like this:
tb_staff containing staff_id, first_name, last_name, base, dept_ward, job_title
tb_courses containing course_id and course
tb_training_done containing staff_id, course_id, date_trained, trainer, venue
I have 1:M tb_staff to tb_training_done and the tb_training_done is linked to the tb_courses 1:1 - not sure if this is right but it's the only way access will do it.
Anyway, my idea was to use a form and subform to enter training done but after setting up the lookup it won't allow duplicate courses i.e. same course done each year. Can anyone explain how the lookup works? Where are the details of courses done stored?
Hope that's not too vague?
View 2 Replies
View Related
Aug 6, 2007
im having a bit of trouble generating a field in one of my queries. i think its fairly simple, all i want to do is have the field in my query to show a date, that is just calculated by subtracting 5 days from the current day. i have something that looks like =Now()-5 but that doesnt work obviously. so im just asking whats the imput going to look like if you want to subtract 5 days from a date? oh and im using short dates for the date inputs
View 2 Replies
View Related
Sep 13, 2004
I am trying to build a report that lists all call in's and all tardies on the same sheet. They are two different tables, that I made queries out of because of calculation fields. Do you know how I can include all the needed data in the same report?
What I'm getting when I try is either all call-in's for each name that has tardies or vice versa. I need to see all data on one report
The reason I didn't just put all the data in one table was because we track call-in's by occurence, but we track tardies by pay period. So each call in is logged in the call-in table with the date it happened on, and the tardies are logged in by pay period, so only the total is stored in the field.
Do you have any ideas? I'm really stuck and I've been workin' on it for three days now and I don't think I'm going to find the solution by myself. Sorry. Thanks!
KellyJo
View 5 Replies
View Related
Nov 3, 2005
Hi,
Please bear with me here as it's a little involved.
I'm doing a staff profile website which includes a section where they can enter their annual/other leave details.
I decided to store their leave in two fields Start_Date | End_Date rather than each individual date that they took - the short and wide approach vs long and narrow.
This has left me needing to do a query that would return all the dates between the start and end dates inclusive.
Example:
StaffID---Start_Date---End_Date
---1-----12/12/2004--14/12/2004
Returns:
StaffID---Leave_Dates
--1-------12/12/2004
--1-------13/12/2004
--1-------14/12/2004
I appreciate i could do this using some script to loop through a recordset and build an array of dates but i wondered/hoped that it could be done using SQL.
As it is an asp page i can't use user defined functions in a VBA module in Access so the solution would need to be pure SQL.
Is this possible?
Any help v.much appreciated.
TS
View 3 Replies
View Related
Apr 4, 2012
I have a scenario where the first three rows of date which have dates of 4/1, 4/4/ 4/6 with ndc 5513026701; next six rows that have dates from 4/8 to 4/20 with ndc 5513014801; next three rows that have dates from 4/25, 4/27, 4/29 with ndc 5513026701.
The issue I am having is I do not know how to have separate min/max dates for ndc 5513026701 since when I group by ndc 5513026701 min = 4/1 ; max = 4/29. I need to have min = 4/1 and max = 4/6 for one row and another row of min = 4/25 and max = 4/29.
Any easy way to sequentially create min/max for each ndc 5513026701? I wasn't sure how to verbalize this so I have attached a sample worksheet.....
View 2 Replies
View Related
Jul 5, 2005
Gee, I know this is probably so simple...I've never in my life worked with any kind of data base program. I've spent 2 hours trying to make it work and it doesn't. I've tried so many things that I can't even remember what steps I did. I'm trying to create a one column list for phone numbers, no names or anything else...the most important thing is that when I add new phone numbers to this list I want Access to alert me that it is a duplicate and not allow me to add it.....first of all it won't let me add entries with dashes such as 312-5964, I tried selecting "numbers" and also "auto number", both didn't work, what am I doing wrong...can someone give me the steps from the beginning please....I don't have time to figure this out and it's holding me back from finishing a task. I have to get working on my Video Professor Learning CD for Access which I have at home, but right now I'm at work and can't do that...hellllllllp! I'm ready to tear my hair out :eek:
Thanks, Rosey
View 2 Replies
View Related
Mar 13, 2006
I have an Access DB I have to put on numberous laptops. The DB is being transported via a CD. When i try to copy the DB from teh CD to a new folder on the laptop I get messages that the DB may have a virus and it cant be copied, or I need to install a microsoft service bulliten...xxxx ( I am not sure what the number is). The DB does contain VBA code and I am certain it is virus free. Is there some setting in access which enables this file to be copied on laptops which do contain virus or firewall protection or must I disable virus protection on these machines before instlaling the program or is it another issue altogether. Thanks.
View 3 Replies
View Related
Mar 27, 2006
Hi
I have genreated an autonumber in my table, at this is used as key. after importing 135 records it starts to jump 48 records before it creates a new. This means that with every record i import after 135 i have a space of 48 between each. So what sort of thing can cause this? and even better how do i fix it?
Best Regard
Roald
View 2 Replies
View Related
Jul 6, 2006
I have been using the forums for the past month and a half, and they have been extremely beneficial to me. I am working on a database that cross references my companies Steel standards to American standards. I am trying to make it searchable in a couple of different ways. I have borrowed code found on this site to make two different search engines. One works very well but the other I am getting hung up when I try to switch from the previous code to mine. below is an example of my code. It is taken from code placed on here previous called "SampleSearch"
Private Sub cmdSearch_Click()
On Error Resume Next
Dim sSql As String
Dim sCriteria As String
sCriteria = "WHERE 1=1 "
'tblSubject qrySearchCriteriaSub
If Me![Spec] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub.Spec = """ & [Spec] & """"
End If
If Me![SteelType] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub.SteelType like """ & [SteelType] & "*"""
End If
If Me![Group11] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub.Group11 like """ & [Group11] & "*"""
End If
If Me![Group143] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub.Group143 like """ & [Group143] & "*"""
End If
If Me![Substitute1, Substitute2, Substitute3, Substitute4, Substitute5, Substitute6, Substitute7, Substitute8, Substitute9] <> "" Then
sCriteria = sCriteria & " AND qrySearchCriteriaSub.Substitute1 = """ & [Substitute1] & """"
End If
sSql = "SELECT DISTINCT [Spec], [SteelType],[Group11],[Group143]from qrySearchCriteriaSub " & sCriteria
Forms![frmSearchCriteriaMain]![frmSearchCriteriaSub].Form.RecordSource = sSql
Forms![frmSearchCriteriaMain]![frmSearchCriteriaSub].Form.Requery
'[Spec], [SteelType],[Group11],[Group143]
'frmSearchCriteriaSub.Requery
End Sub
I apologize also because I do not know how to post this in a scrollable window. If someone could help me with that too.
The problem with the code is that I am using a form to filter a query, this will then display the table of the steels that meet the requirements. However, I have altered all of the fields to my names and the combo boxes have my information, but they do not seem to place any parameters on the query. I attached the original DB that I got this code from any help would be appreciated.
Riley
View 2 Replies
View Related
Apr 5, 2007
I have a access 2002 database that was handed down to me.. this program does some document control, set up with access rights for different users.I got into it to clean it up a bit and I've hit a snag. I converted the database from a 2000 to a 2002. Amidst playing around with the Log-In screen somehow my Log In button stopped working; except if you type your password and then hit enter.Now the Log In button ( cmdLogIn_Click() ) is pointing at the same exact script as the ( txtpassword_KeyDown(KeyCode As Integer, Shift As Integer) ) function.I don't know any VB and I'm not really familiar with Access, so if anyone could decode this for me I would be really grateful. Here is the script that those two functions are pointing to:Private Sub LogIn_Click() Dim strPassword As String Dim strPasswordAttempt txtPassword.SetFocus strPasswordAttempt = txtPassword.Text cboUsername.SetFocus strPassword = DLookup("[Password]", "User", "[Username] = '" & cboUsername.Value & "'") If strPasswordAttempt = strPassword Then strUsername = cboUsername.Value intAccessLevel = DLookup("[AccessLevel]", "User", "[Username] = '" & cboUsername.Value & "'") bolApprover = DLookup("[Approver]", "User", "[Username] = '" & cboUsername.Value & "'") bolEditDocumentInfo = DLookup("[EditDocumentInfo]", "User", "[Username] = '" & cboUsername.Value & "'") bolEditUserInfo = DLookup("[EditUserInfo]", "User", "[Username] = '" & cboUsername.Value & "'") bolEditReferenceDocuments = DLookup("[EditReferenceDocuments]", "User", "[Username] = '" & cboUsername.Value & "'") bolViewAllApprovers = DLookup("[ViewAllApprovers]", "User", "[Username] = '" & cboUsername.Value & "'") bolDocumentControl = DLookup("[DocumentControl]", "User", "[Username] = '" & cboUsername.Value & "'") ' MsgBox "Your access level is " & intAccessLevel Startup ' run startup sub DoCmd.OpenForm "Welcome", acNormal DoCmd.Close acForm, "Login" LogEvent strUsername, Now(), "Login Successful", "Network Username: " & strNetworkUserName & " on Computer " & strComputerName 'LogEvent strUsername, Now(), "Login Successful", " on Computer " & strComputerName Else MsgBox "That password is incorrect. Try again." LogEvent "Unknown", Now(), "Login Failed", "Attempt: " & CStr(cboUsername.Value) & " , " & strPasswordAttempt & " Network UserName: " & strNetworkUserName & " on computer " & strComputerName End If End SubWhen you click the Log In button it does actually run the script, but it gives me the "The password is incorrect. Try again." message even if the password is correct. I can just click into the txtpassword box and hit enter and it will log me into the database.P.S. I say again, this isn't my code.. its probably super ugly, but I cant' tell :o
View 3 Replies
View Related
May 1, 2007
Hello all active members of this forum,
Like I stated on the title, this forum got me into trouble. By following the reading in this forum and some recommendations from the regular users I have created thre database for the place I work at. now they want me to be the official DB admin! :eek:
So now I'm coming back to you guys for more advice... :rolleyes: what reading should I do to better my Access knowledge over all.
Any recommendation is welcome.
I have already contacted th local college and they do have a distant learning class for Access and I will be taking it the next semester, but I would like to do some reading into becoming a REAL Access programmer with a solid foundation.
There must be some good books out there to purchase to get me started. So all are welcome to give me some feedback.
Thanks!
René
View 14 Replies
View Related
Sep 6, 2007
Access 2002.
Hey guys-
I have a software program that I am exporting data out of into excel (it's SQL based). From Excel, I then am importing into Access into an existing table previously created from a similar file (same columns, just different record sets). I am running into problems when importing files...
If I import into a new table, and have Access create the table based off of the Excel file- it works fine. If I try to import more records into this same table, it tells me it failed to import and that an error occured (no error's table created, no error number given). If I delete the original records in the table, and re-import the SAME RECORDS that were originally imported to create the table- it doesn't work. It will only import my files if it creates a brand new table for each import, every time.
Can Access not import into an existing table? It should- but I dont get what's going on here. I have tried DBF, HTML, txt files- all the same results. I really don't want to have to create a new table each time- as now my Queries will have to be updated everytime I create a new table. Can you please help?
View 1 Replies
View Related
Dec 16, 2005
I don't how this happened but a crucial field (ClientID) in my Clients table changed from Autonumber to Number. It's the primary key and linked to other tables. Access won't let me change it back...and until i do my entire database is at a standstil - cannot enter new clients.
View 2 Replies
View Related
Dec 11, 2006
Can someone please help me, I might have my logic a little backwords.
I have a table (tblLoanDetails)
LoanNumberID
etc.
etc.
etc.
EscrowCompanyID
then I have a table called (tblEscrowCompanies)
EscrowCompanyID
EscrowCompanyName
EscrowCompanyAddress
etc.
etc.
EscrowOfficerID
then I have a table called (tblEscrowOfficers)
EscrowOfficeID
EscrowOfficerName
EscrowOfficerSalutation
EscrowOfficerEmail
What I am trying to do is when someone is filling out the first table (tblLoanDetails) they have a dropdown to choose the escrow company, then they must choose the escrow officer
Each escrow office can have many officers, however, when they choose the escrow officer from a dropdown, I only want that offices escrow officers to appear in the dropdown.
Any help would be greatly appreciated
thank you
Josh
View 1 Replies
View Related
Jan 17, 2008
I have been asked to redesign a database that tracks a huge number of data points. These are projects and the original table had over 100 fields. I have managed to separate them to related tables in an attempt at normalization. They are:
tbl_workorders (main project info)
tbl_services (services ordered)
tbl_contacts (internal company contacts)
tbl_customers (customer information)
tbl_project_dates (milestones of project)
Now this is different from other databases I've designed because all of the tables need a one-to-one relationship with the main table (tbl_workorders).
Am I heading for trouble with so many tables existing in a one-to-one? Also, The table tbl_workorders has its primary key as an autonumber. I want any new order on this to create matching foreign keys on all the other tables...I assume this should be handled since I have enforced referential integrity with cascade on update/delete for all the other tables.
Thanks for your feedback!
View 12 Replies
View Related
May 16, 2005
Hey, I have a query to calculate the stock balances and their values.....the client is using FIFO method...therefore, the stock may have different values at different stage......but they want to display the latest unit price in the report.......I selected "Last" at the UPrice column in the query, but the query doesn't give me the value I want.....
e.g.
Date In Out UPrice
03/12/05 12 0 22.00
03/14/05 0 12 22.00
03/15/05 15 0 24.50
In this example, the report should displays 24.50, but it displayed 22.00.....
can someone point to me where I have made the mistake?? Thank you
View 1 Replies
View Related
Oct 28, 2005
Hi,
im realy realy stuck this time.
This is the problem:
i have 2 tables. groupproject, employeproject.
Groupproject has: groupcode(pk), employeCode(pk), projectCode(pk)
employeeGroup has: employeeCode(pk) and projectCode(pk)
a project can have a group and a group can have members. A member is related to a project. Now i want to display all the members who are not in the selected group . For example, i select group 1 and i display all the members who are not in 1. The problem i keep have is that for example:
employee 1 is on group 1 and in group 2 and goup 1 is selected, he wil be show. This is because i use a statment "<> selectedgroup" . So the query runs trough te tables, comes back with group 1 and says, ok employee 1 is in the group i will not show. BUT THEN the query comes to eployee 1 in group 2 and the query says, hey your not in group 1, i throw you on the list.
can someone help me with this irritating issue.
i tried this query
SELECT ProjectGroup.ProjectCode, ProjectGroup.GroupCode, ProjectGroup.EmployeeCode FROM ProjectMembers LEFT JOIN ProjectGroup ON (ProjectMembers.ProjectCode=ProjectGroup.ProjectCo de) AND (ProjectMembers.EmployeeCode=ProjectGroup.Employee Code) WHERE (((ProjectGroup.ProjectCode)=Forms!GroupView!Proje ctCombo) And ((ProjectGroup.EmployeeCode) Is Null)) Or (((ProjectGroup.GroupCode)<>Forms!GroupView!GroupView));
View 3 Replies
View Related
Jan 2, 2006
hi,
i am having trouble with a criteria expression that seems to have an issue when it runs into null data in my table.
the query column is as below ...
DateSerial(Year([SomeDate]),Month([SomeDate]),1)
and the criteria for this column is ....
DateSerial(Year(Date()),Month(Date()),1)
So basically I am looking for those fields that match the first date of this current month.
for some reason when there are null values in the table this thing chucks back data type mismatch error but when i take the criteria away its all good
any ideas why this is happening?
View 1 Replies
View Related