Combine One Table With Three Date Fields (all With Short Dates)
Feb 14, 2013
I have a table called Packages, in this table I have multiple fields with just short dates example of fields (ID), (Home_1), (Home_2), (Home_3) and (Home_4). What I was wondering is there a way to comine all of the Home fields into one for the purpose of counting the number of dates for all the records. Total number of dates of all the Home fields? I am using Access 2010
View Replies
ADVERTISEMENT
Jun 21, 2013
I want to be able to set text boxes so that if one enters a date and a time it displays in the format "dd/mm/yyyy hh:mm", but if one just enters a date is displays in the format "dd/mm/yyyy". Is this possible?
Stipulating "dd/mm/yyyy hh:mm" means that when you just enter a date it adds "0" values for the time e.g. entering "21/6/13" gives "21/06/2013 00:00".
General Date allows for an optional time, but it means that when you do enter a time it gives you seconds as well "dd/mm/yyyy hh:mm:ss" - and I don't want that.
View 7 Replies
View Related
Feb 12, 2014
I have a table that requires 260 fields for a specific reason. Is there any way to bypass the max number of fields allowed in a table?
View 14 Replies
View Related
Apr 24, 2013
I have a table which includes a start date field and completion date field for housebuilding.
I am trying to extract all records that have either a started date or a completed date between 2 dates supplied by the user. I have tried to use Between on both fields but that doesn't return results between the fields.
It workd if I just do it on EITHER the start date field OR the completion date field so that implies to me that I need to break it into 2 queries, one returning start date recrods and the other returning completion date records but then I would need to have somthing that removes records that appear in both the start date and the completion date results.
View 7 Replies
View Related
Oct 19, 2014
how can I combine two text fields and format them as a date.
Text Field 1: Jan
Text Field 2: 2014
View 3 Replies
View Related
Apr 22, 2015
I have a product table that includes the name of the product, the quantity ordered, and the unit price. This is a summary table for the whole year showing all of the orders. The Primary Key is [ID] from the [tblOrders] table. I attached a screen shot of my query. I don't know if you can see it. I want to generate a report where each product is listed once, the unit price for that product is listed, the total number of that item that was ordered throughout the year, and finally, the total amount spent for each item during the year.
View 2 Replies
View Related
Jan 30, 2008
Hello,
In access 2003 i have an external Oracle table named EXT-COM_EXTRA_DATA_FIELDS
in this table I have the following fields: COM_DATA_KEY, COM_DATA_FIELD_NO, COM_DATA_VALUE
From this I have created a query named: LOOKUP-BARCODES-10 this looks at the above table by filtering the
the records on the field: COM_DATA_FIELD_NO where this =10.
Also I have created a second query named: LOOKUP-BARCODES-20 this looks at the above table by filtering the records on the
field: COM_DATA_FIELD_NO where this =20
Below is sample data in the table:
COM_DATA_KEY; COM_DATA_FIELD_NO; COM_DATA_VALUE
009A/s 10 03010303165001
009A/s 20 04350309115002
010B/P 10 05150909116001
010B/P 20 06150909116002
011C/X 10 07281809217003
011C/X 20 N/A
The problem is i would like to combine the numbers in the COM_DATA_VALUE field for the same product (ie the same COM_DATA_KEY
record) on the same rows without any duplicate records as shown below:
COM_DATA_KEY; COM_DATA_VALUE; COM_DATA_VALUE (2)
009A/s 03010303165001 04350309115002
010B/P 05150909116001 06150909116002
011C/X 07281809217003 N/A
As you can see from above some records only have data in one COM_DATA_VALUE (like 011C/x) where COM_DATA_FIELD_NO = 10 but no
data for the same product where the COM_DATA_VALUE = 20.
Im thinking maybe i can create a new join query that looks at the above two query’s and combines the values in the COM_DATA_VALUE for
the same product onto the same record row but im not sure how to go about this without creating duplicates & its been some time since ive done joined queries. Any help would be great?
ive attached a cut down version of the database with the table imported from oracle rather than being linked to oracle if this helps.
Thanks
Kevin
View 2 Replies
View Related
Apr 25, 2014
I have a table "MansComps" which includes two fields, the "Index" field which contains a number, e.g "5" and the "Tabletype" field which contains a letter e.g "T". i have created a query based on this table, which combines these two fields and displays the result to a third field which I call "Components".
field: Index
1, 2, 3,....
field: Tabletype
T
field: "Component" has to be like this:
T00001, T00002,...
I have managed to combine the fields in my query using the expression:
Component: [Tabletype] & " " & [Index]
but the results appear without the leading zeros, like T1, T2..I have set my Index content to be a number and as a primary key and the Tabletype as a text. I also tried to change the format of Index to "00000" which works for the Index field separately but not for the Component field.Should I do something in the format of the Component field?
View 4 Replies
View Related
Nov 16, 2006
Hi people,
I could do with some help,
I have a combo box which holds a list of times which I have entered in it.
eg. 08:00, 08:30, 09:00 09:30, 10:00
I have set the format of the combo box to be short time 00:00
However, when I move the value that has been selected in the combo box to either an sql query or a text box say...
Me.txtbox1.value = me.combo.value
When the value is transferred I get a long looking time like this 08:30:00
Can anyone tell me why this is happening and how I can get it to just appear as a short time like 08:30
Many Thanks
Jay
View 5 Replies
View Related
Jul 31, 2013
I'm trying to select a range of relevant dates for an amortization calculation (see my earlier thread on this subject here), but I'm having a bit of trouble making the SQL work.
I have a table called "t_AllMonths" that has only one field: MonthStartDate which contains the first day of the month for a very wide range of months over something like a ten-year period. I'm calculating amort for assets which will be amortized for some subset of those months (defined by the asset's Amort Start Date and Amort End Date). Further complicating matters, the amortization may be suspended during certain "hiatus" periods when the asset it not planned to be in use, and may differ by which business units make use of the asset.
So, I have three tables.
Table: t_Assets
Fields: AssetID (autonumber; primary key), Asset_Name, Asset_Cost
Table: t_AllMonths
Fields: MonthStartDate
Table: t_AmortPeriods
Fields: AmortPeriodID, AssetID, Amt_Period_Num (which I don't expect to use in this), StartDate and EndDate
Right now, I'm just trying to pull the range of dates between the earliest amort start date and the latest amort end date. (Min of StartDate and Max of EndDate, respectively) for a given AssetID.
My sql looks like this:
SELECT t_AllMonths.MonthStartDate,
Min(t_AmortPeriods.StartDate) AS MinOfStartDate, Max(t_AmortPeriods.EndDate) AS MaxOfEndDate,
t_Assets.AssetID
FROM t_AllMonths,
t_Assets INNER JOIN t_AmortPeriods ON t_Assets.AssetID = t_AmortPeriods.AssetID
WHERE ((t_AllMonths.MonthStartDate) Between [MinOfStartDate] and [MaxOfEndDate]);
I keep getting an error message that reads "Run-Time Error 3122: You tried to execute a query that does not include the specified expression MonthStartDate as part of an aggregate function."
View 5 Replies
View Related
Aug 5, 2005
I am creating an online post, similar to a guestbook. When a user submits an entry, I am storing the date and time in a column titled "Timestamp", which is formatted 8/4/2005 9:16:58 ("General Date"). I am running the table through a query which is then posted on the web.
What I would like to do is this: I would like to use Timestamp to display the date that the entry was submitted, but not the time (basically, "Short Date"). Can I exclude the time using a query without changing the actual data stored in each record of the table? I understand that the time stored is completely different than the time displayed, even in the table. How can I do this?
View 2 Replies
View Related
May 29, 2005
In my Query I have a Date Received field and a Date Approved field.
I would like to calculate the number of work days, which excludes weekends, between Date Received and Data Approved fields.
It would be more desirable to calculate the number of work days, excluding weekends and governmnet obsereved holidays.. but I don't know if that can be done... If not I can stick with the number of work days excluding weekends.
How would I go about doing this? I would need to add a new column to my query?
What would I put for the field and criteria? What kind of expression do I use?
Any help will be appreciated, thanks
View 14 Replies
View Related
Jun 27, 2013
In my table I have the following 4 fields with the associated date field:
Bronze: 11/1/2013
Silver: 5/1/2014
Gold: 11/1/2014
Platinum: 5/1/2015
I am trying to calculate a value based on comparing the current date to the dates in these fields. I am using the below formula. However, using 6/27/2013 as the current date, my formula keeps resulting in "Bronze" when it should result in "Standard" Am I doing something wrong?
=IIf(Date()<[Bronze],"Standard",IIf((Date()>=[Bronze]) And (Date()<[Silver]),"Bronze",IIf(Date()>=[Silver] And Date()<[Gold],"Silver",IIf(Date()>=[Gold] And Date()<[Platinum],"Gold","Platinum"))))
View 5 Replies
View Related
May 23, 2007
I'm having issues querying a short date field in my database as it returns no data no matter how i format the date
SELECT * FROM Maintenance_Dbf
WHERE [Date Logged] = #$date#
ORDER BY Maintenance_ID ASC
$date has been set to:
2007-05-21
2007-21-05
21-05-2007
05-21-2007
07-05-21
07-05-21
21-05-07
05-21-07
2007/05/21
2007/21/05
21/05/2007
05/21/2007
07/05/21
07/05/21
21/05/07
05/21/07
and no joy
If i use this on a medium date field it will work fine??
Regards
Liam
View 3 Replies
View Related
Sep 11, 2013
I use this
'WHERE ((OperationalRiskEventTable.DateReported)>=Forms!U pdateForm!UDateBegin And (OperationalRiskEventTable.DateReported)<=Forms!Up dateForm!UDateEnd)'
in a query by form.
The problem is that you have to enter a date in the between values for results to show. If I don't enter information into a different field such as Full Name but I enter in 40 into Age then everyone that is 40 years old will show. On the other hand if I enter 40 into the Age field but I leave the Date Reported fields empty then no results will show.
How can I change it so that I don't have to enter dates into the date reported fields for results to show?
View 4 Replies
View Related
Oct 29, 2014
Anyway, I would call myself intermediate level at best with Access. I never expected to have to do so much with it, but when my bosses found out I could do Access basics, they began demanding more and more.
I manage an EMR from which a datapull occurs on discharge to various access databases.
They wanted me to add a triage patient data pull to track what procedures are being done to triage patients. So I built a database with the following 2 tables.
tblTriageVisits and tblTriageProcedures
tblTriageVisits has the following fields
-Patient ID
-Export Time
[Code].....
The tblTriageVisits stores all the patients triage visits. The other table stores what was done to each patient on those visits
It should also be noted that this EMR exports times in number of seconds since 12/31/1975, so TimeProcFMS is the number of seconds since that date for example.
The pulls work great and the duplicate record elimination method works great.
I have to design a couple of different reports based on this data and one in particular has pretty much flumoxxed me.
I need to make a report that lists each patient by date they were there and then shows what was done to them. I have tried several different variations of this as both queries and reports. The report breaks down when I try to get it to show just those procedures that would be for that triage visit. I got to the point where it would group by day and then sort the patients alphabetically. Then I added in the visit fields. And it would put all triage procedures for that patient from all their visits in each visit.
So, I was like great, let me filter out those that don't occur between the two dates, admission and discharge
I used the following two formulas (the first one on the procedure name field the second on the procedure date field)
=Switch(DateAdd("s",[TimeProcFMS],#12/31/1975#)>=[Admission DateTime OB DateTime] And DateAdd("s",[TimeProcFMS],#12/31/1975#)<=[LD Discharge Date/Time DateTime],[Procedures FMS])
=Switch(DateAdd("s",[TimeProcFMS],#12/31/1975#)>=[Admission DateTime OB DateTime] And DateAdd("s",[TimeProcFMS],#12/31/1975#)<=[LD Discharge Date/Time DateTime],DateAdd("s",[TimeProcFMS],#12/31/1975#))
And they work, sort of. They do eliminate those procedures that occur outside of the date range I am looking for. However, the access report still leave spaces in the report where the filtered out items would be.
Did I approach this problem correctly? And if so, how do I get rid of those spaces?
Note, I can read and mostly understand SQL, but am not comfortable working in it yet. And the Access SQL box gives me a headache, it is so jumbled up.
View 14 Replies
View Related
Jan 17, 2006
I have a query where one field is Date:Now() so that todays date is forced in. However, it is giving me the date and time. I only want the short date, how do I achieve this???
Thanks!
View 2 Replies
View Related
May 23, 2007
Hi im having issues runing a query on a short date field in my works database calls [Date Logged] I am actually running the query from PHP/ODBC but have tryed running it in acess also..
I am using this query:
SELECT * FROM Maintenance_Dbf
WHERE [Date Logged] = #$date#
ORDER BY Maintenance_ID ASC
Where $date is i have replaced with all of the following date types..
2007-05-21
2007-21-05
21-05-2007
05-21-2007
07-05-21
07-05-21
21-05-07
05-21-07
2007/05/21
2007/21/05
21/05/2007
05/21/2007
07/05/21
07/05/21
21/05/07
05/21/07
yet i cant get any results returned..
Here is an example date from RAW tables 26/04/2007 12:25:33
Any idea's? even the query builder in access doesn't pull up any records :S
Regards
Liam
View 3 Replies
View Related
Aug 11, 2006
I have a field defined as Date/Time Short Date which shows values like 8/01/2006, 8/10/2006, etc and I need to select dates in a range.
However, when I write a query with code like:
SELECT AMOUNT
FROM INVOICE_TBL
WHERE PICK_UP_DATE BETWEEN 08/01/2006 AND 08/31/2006
It doesn't pick up the records I also tried >= <= with the same results.
Any help would be appreciated.
Thanks,
Steve
View 2 Replies
View Related
Jul 7, 2014
Most my short text fields on my form are normal, but some have scroll buttons like a memo box and it's annoying, especially because the user can't jump to the next field by pressing return.
How do I make them normal?
View 10 Replies
View Related
Feb 25, 2013
I have 2 gig of order data which has duplicates due to different invoice dates. How can I combine the dates into one cell so I only had one row of Order data.
i.e. order number, price, order date, invoice date
same order number, same price, same order date, different invoice date.
How do I combine the second line with the first so that I only have the data once.
View 10 Replies
View Related
Oct 13, 2006
Hi folks - I saw a thread last week re how to extract the year from the date field possibly using date serial but can't find it can anyone help - it is probably very simple but i can't get it to work.
Ta
Humph
View 2 Replies
View Related
Oct 13, 2006
Hi folks - I saw a thread last week re how to extract the year from the date field possibly using date serial but can't find it can anyone help - it is probably very simple but i can't get it to work.
Ta
Humph
View 2 Replies
View Related
Mar 21, 2006
On one of my forms two of the fields are "Date Contact Initiated" and "Date Contact Concluded". I have the property for this field set to Short Date.
These two fields autofill with the current date when the form is opened. When the date for both of these fields is the same there is no problem. When the "Date Contact Initiated" is different from the "Date Contact Concluded", the user has to manually go to the "Date Contact Initiated" and change the date ( most often to the previous day.)
What is causing some confusion is that when they go to the "Date Contact Initiated" field to change the information it displays not only the autofilled date but also the autofilled time. There is another field on the form where the time for the contact initiated is to be entered.
Is there a way to format this date field to only show the autofilled date and not the autofilled time?
Thanks for the help!
Chris :)
View 2 Replies
View Related
Aug 22, 2006
Hi,
I have a huge problem!!!! Access seems to be picking up settings from somewhere which means that the Short date = mm/dd/yyyy and not dd/mm/yyy as set in the regional Settings!
Does anyone have any ideas why?!?!
Regards
H.
View 4 Replies
View Related
May 14, 2013
I have a totals query that displays the sum of what products we ship each day. A process in the system automatically assigns the date/time to a ShippingDate field when an item is marked as despatched.
The totals query allows users to view what products are shipped between a period specified by the user.
The problem I am getting is that when the user inputs dates into fields [txtStart] and [txtEnd], the query fires up but will not display any records as a start time 00:00:00 and end time 23:59:59 was not input.
I don't want users to have to do this but cannot think of a way around it. My criteria code in the query for the shipping dates is
Code:
Between [Forms]![Switchboard]![txtStart] And [Forms]![Switchboard]![txtEnd]
Can I append the start / end time onto the code above somehow or is there another method I can utilise that is probably so glaringly obvious I have missed.
Usually a query allows me manipulate a field property sheet but in this case there is nothing obvious to select like format.
View 2 Replies
View Related