I currently have a form where I would like the form to display the oldest account first, so the overall objective is the employee will action the oldest account first and then go onto the next one etc.
As you can see it consists of the name and a date of the backup. When it populates the combobox I want it to go in date order I newest to oldest. At the moment its going of the first number.
Table 1 has all the items I am trying to sell with sell by date after which I cannot sell this item. Then in Table 2 I have forecasted sales. So now I am trying to calculate stock consumption to see if I will be left with any stock that I cannot sell.
So now somehow I need to deduct sales forecast from my stock holding but it needs to go by date i.e. consume all stock for Item 1 with date 16/09 before moving to Item 1 with sale by date 23/09.
So based on the attached example, I can see that on 16/09 I will consume only 5 cases from sell by date 16/09 and another sale is 18/09. So that would give me information that I will be left with 95 items dated 16/09, which I cannot sell because they will be out of date.
I would like also to include the logic that if Item is out of date it would move to the next sell by date.
So in this case sale of Item 1 forecasted for 18/09 (94) would consume the whole stock (50) with date 23/09 and another 44 from date 01/10.
For Item 2 I can see that units with Sell by date 30/09 will be consumed on 25/09 and I will start taking stock from next sell by date which is 14/10.
I have Query which has dates in multiple columns. I need to know if there is a formula that will allow me to display the oldest date and the newest date?
Below is the output of my Query in Excel. I need the output to have two additional columns: Beginning Date and End Date. Based on the example below, I would need the beginning date to show 6/21 and the end date column to show 6/23 so when I export to excel, it shows these two dates. In Excel, there is a min/max formula that can do this but it looks like the min/max in Access only displays the min/max data? Unfortunately, creating this formula is not an option after the fact. Secondly, I need the word "DIRECTION" to show in it's own separate column in the in the query. I don't know if I can do this without adding another table to the Query or if I need can just add a column in design view and put something in the criteria that will do this.
I have included an example of my current output and what I need the output to read.
Current Output Sunday In Out Monday In Out Tuesday In Out
I created my first RDB input form and it works fine. In the subform new records are created at the bottom row. The subform has a date field. The main and sub forms are based on tables.
When I open the input form I would like to see the subform records sorted by the date field but I don't know where to look for help on that. Can somebody point me in the right direction?
I am including my form in design layout just in case it will help.
A few months ago I created a report that displays the results of a long union query comprising a dozen or so individual queries, each containing an expression that yields a date (or sometimes date and time). I set the report to group by query and then sort by the date expression. Now for some reason that I can't fathom the report has always only ever offered me the option to sort the date "A to Z", I infer it thinks the date is text, but this misunderstanding has never actually stopped it sorting by date perfectly well. It worked. No problems.
However I have recently added formatting to some of the queries so that they just display date, not date and time e.g. Format([dateandtime],"dd/mm/yyyy"), and now the sort by date in the report no longer works. None of the sorting or grouping options have changed, but it now sorts just by the "dd" component of the date - so it thinks 21st June is later than 20th July. why?
Option Compare Database Option Explicit Function Backup() Dim fso As FileSystemObject Dim sSourcePath As String Dim sSourceFile As String Dim sBackUpPath As String Dim sBackUpFile As String Dim strSQL As String
sSourcePath = Application.CurrentProject.Path sSourceFile = Application.CurrentProject.Name sBackUpPath = Application.CurrentProject.Path & "Odontiatreio BackUp" sBackUpFile = sSourceFile & Format(Date, "ddmmyyyy") & " " & Format(Time, "hhnnss") & ".mdb" 'Add new file to table. 'Assumes tblFile has 2 fields: ' FileID (AutoNumber) ' FileName (text) strSQL = "INSERT INTO BackUp(BackUpFileName) " _ & "Values('" & sBackUpFile & "')" CurrentDb.Execute strSQL 'Delete oldest filename if there are more than 5 records. strSQL "DELETE * FROM BackUp " _ ============>Error<========= & "WHERE BackUpID IN(" _ & "SELECT MIN(BackUpID) FROM BackUp " _ & "HAVING COUNT(*)>5" CurrentDb.Execute strSQL, dbFailOnError Set fso = New FileSystemObject fso.CopyFile sSourcePath & sSourceFile, sBackUpPath & sBackUpFile, True Set fso = Nothing End Function
Error: Compile error: Expected Sub, Function, or Property
Set fso = New FileSystemObject fso.CopyFile sSourcePath & sSourceFile, sBackupPath & sBackupFile, True Set fso = Nothing
End Function
---------------------
Now, what I want to do is delete the oldest file after there have been 5 files copied. In other words, I will be running this once a day and only want to retain the newest 5 copies. Once the sixth has been copied, delete the oldest one in the directory.
I am trying to identify how long inventory has been in a specific location. The information that I have is the current inventory level and movements that have put the inventory there. Assuming FIFO I would like figure out the following.
ex: I have 4 movements with various dates AND I have 3 pieces currently on hand, how do identify the date of the last 3 movements (assuming that the one that has been moved out was the first one in)? Of course there is a long list of part #'s, on hand quantities and movements into the location so the logic should work for all.
I am bringing in two fields into a table which looks like this:
Field 1 Field 2 A 2006-07-25 A 2006-08-21 A 2006-09-21 A 2006-10-21
This is how it's sorted and do not forget that field 2 is a text field.
Now i made two different queries pulling in both Field 1 and Field 2, however in one query i'm pulling in First of Field 2 and in the second query Last of Field 2. For some reason, i'm getting 2006-10-21 as a first and 2006-07-25 as last.
Hey Im a newb waiting on my books but i need to get this done
Im trying to Pull four fields from a table called Hottopic based on their control number and then sort those by date I know io have got to have the query line all messed up I receive the following error
Microsoft JET Database Engineerror '80040e14'
Syntax error (missing operator) in query expression '<Date>'. Hot Topic1.asp, line 14
The Code Im using is as follows: <HTML> <HEAD> </HEAD> <Body>
<%@Language = "VbScript"%> <!--#include file="adovbs.inc"--> <% dim objConn,objRec set objConn=Server.CreateObject("ADODB.Connection") objConn.Provider="Microsoft.Jet.OLEDB.4.0" objConn.Open "\lou1-web01 obohelpshpsmateshpsmate v3asphot.mdb" Set objRec = Server.CreateObject ("ADODB.Recordset") objRec.Open "SELECT [Control Number], [Date_] FROM Hottopic WHERE [Control Number] = '10029' Order By <Date>",objConn,adOpenKeyset,adLockOptimistic, adCmdText %> <TABLE BORDER=0 WIDTH=600> <TR><TD COLSPAN=4 ALIGN=CENTER><FONT SIZE="+1"><B>Hot Topics SOG</B></FONT></TD></TR> <% While NOT objRec.EOF
I have a Table that is used to collect data from client’s phone calls. There is a field for the Client’s name and another for the date the client called (There are a whole lot more fields, but for simplicities sake let’s focus on these two). I have sorted the table on date and indexed the date field. I need to add a “RECORD NO.” field in order to get some queries to run correctly. This field will be autonumber. I would like to have the RECORD NO. field to run in conjunction with the date, that is RECORD. NO. 1 would be the earliest date in the table and the last RECORD NO. would be the most recent date that a client called in. I have verified that the table is sorted by date, but when I add the RECORD NO. field the table reverts to sorting alphabetically by client’s name. The client’s name field is not indexed. I can’t figure out why it is doing this. Any ideas or suggestions as to how to correct this? Thanks.
I have two tables put into one query to generate a report. One table is Projects and the other is Project Additions. Both tables have the same fields and I want to be able to sort using date criteria. It will sort by the Project table dates but not by the Project Number Additions table. I have tried to put criteria in both field but then it will not work. Is there a better way to do this? The criteria I have put in is under the Project Number Table is between>=[Enter Start Date] and <=[Enter End Date].
In a report I need to sort by the month. the table field is "Appointment_Date" this is the code I am trying to use in the query behind the report . Appointment_SortMonth: Format([Appointment_Date],"mmmm" & " " & "yy") but it doesnt sort. also the SORTING & GROUPING MENU does not work either. what do I try Now ???. your assistance will be appreciated.
In order to do a report, I would like to make it so that each customer is on its own row within this query, with his or her total days added up. I have no idea how to go about it.
I'm trying to sort dates by the latest date when the query returns multiple IDs with different results. Ex. ID1 1/1/2006 1/8/2006 ID2 1/2/2006 1/9/2006
In this example I would want ID1 with the date of 1/8/2006 and ID2 with the date of 1/9/2006 since they are the latest date. I will have many IDs that I need to run a query on that will all return the latest date. TIA
I have a calculated date field in a query...if I try and sort by this field I get a data type mismatch.
[CONTREFF] is a date field in a table, [TERM] is a number field in a table. I am trying to calculate the year the contract expires in the "EndTerm" field. The calculation works fine, but I can't sort it.
I have a form that allows the user to specify, among other things, date ranges for data to be displayed in a subform (in a form, not datasheet).
In the subform, the user can click any column heading to sort the records by record number, employee name, department, etc. The Click event calls a function: Private Sub lblReviewDate_Click() Call SortForm(Me, "ReviewDate") End Sub
Here's the function module code: Function SortForm(frm As Form, ByVal sOrderBy As String) As Boolean 'Sort form column headings OrderBy to the string. Reverse if already set. If Len(sOrderBy) > 0 Then ' Reverse the order if already sorted this way. If frm.OrderByOn And (frm.OrderBy = sOrderBy) Then sOrderBy = sOrderBy & " DESC" End If frm.OrderBy = sOrderBy frm.OrderByOn = True SortForm = True End If End Function This works great - except on date fields, which are set to the medium date format as DD-Mmm-YY. I end up with a sort list that looks like this: 21-Apr-05 24-Jun-05 29-Jun-05 11-Jul-05 05-Apr-05 07-Jun-05 A sort in the reverse direction is equally messed up. Can someone advise what to do about this?
I am using Access 2007.I have a report that has 2 subreports within it.One of the sub reports input is from a table (Work Order Parts) whose records have a field called "DisplayOrder". This is a numeric field that I use to enable the user to specify the exact order that they want the records to be displayed in a form or report...well that's the plan anyway.
I can't seem to get the subreport to sort on the "DisplayOrder" field.
I have tried to set the Property value "Display Order" to "[Workorder Parts].DisplayOrder" but this doesn't seem to make a difference. The "Order By on Load" is set to "Yes".
Here is the "Record Source" value : SELECT DISTINCTROW [Workorder Parts].*, Parts.PartName, [Workorder Parts].Notes FROM Parts INNER JOIN [Workorder Parts] ON Parts.PartID = [Workorder Parts].PartID;
Ive created a form and one of the fields is a field called "Due Date"
I want to create a button that once pressed will sort the records in order of due date with the oldest being record 1.
How I can get a button to manipulate fields.
Ive got a set of buttons at the bottom of my form (Ive placed them in the footer) that were set up using Access automatically. They go to first, last, next and previous records. Ive also set up two extra, one that creates a new record and another that sets the record.
The thing is that the set record button I would actually like it to take the data in a field called "Frequency", add a random number to it and then set the record.
I need to make a query that will show the oldest cases and then open this one in the main form. It will be possible that there could be several cases with the same date. For example the query runs and the results are 7, how could I get one of those cases in the main form.
The idea is that a person will click on a button called "next case", the query will run and then it will open the case in the main form.
I have a table with sales by day. I want to display the data in a graph summarised by week but the period spans several years. If I format the date thus Format(MyField,"yyyy ww") then Access sorts the results thus 2003 1, 2003 10, 2003 11 but it should be 2003 1, 2003 2, 2003 4 etc.
How can I get Access to sort in ascending order correctly on the formatted date?