Selecting data between to specific dates in a form

Sorry if this is an easy one but I am new to this area.

I have created a query from our SQL database that list all hours booked by 
eack employee and the date booked, from when we 1st started collectin thi 
information.

I am wanting to create a form that anyone can go into and select a date 
range so that the can calculate the hours between these dates.

Th other problem that I have got is that the date are in number format and 
not in date.  How dan I format this correctly?

Regards
0
Utf
11/16/2007 9:10:01 AM
access 16762 articles. 2 followers. Follow

1 Replies
1264 Views

Similar Articles

[PageSpeed] 21

The first thing to do will be to convert your number field into a real 
date/time field.

To do that:
1. Open your table in design view.

2. Add a new field, of type Date/Time.

3. Save the table. Close.

4. Create a new query using this table.

5. Change it to an Update query (Update on Query menu, or on the ribbon in 
A2007.)

6. Drag the new date field into the grid.

7. In the Update row, enter an expression that parses the number correctly. 
For example, if your have the number 20071231 for the last day of this year, 
use:
    DateSerial(Left([f],4), Mid([f],5,2), Right([f],2))
where you replace the "f" with your field name.

8. Run the query. Verify that the dates are right.

9. Open your table in design view, and delete the numeric field.

Now that you have a real date/time field, you can add text boxes to your 
form, and filter it ot the date range and employee you want. For an example 
of how to write the code to filter the form, see:
    Search form - Handle many optional criteria. Sample database
at:
    http://allenbrowne.com/ser-62.html

Now the form is filtered, you can add a text box in the Form Footer section 
can then give you the total. For example, if you have a numeric field named 
Hours, the Control Source of the text box in the form footer would be:
    =Sum([Hours])

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"The Rook" <TheRook@discussions.microsoft.com> wrote in message
news:67E21585-9175-4161-9131-190C03529D09@microsoft.com...
> Sorry if this is an easy one but I am new to this area.
>
> I have created a query from our SQL database that list all hours booked by
> eack employee and the date booked, from when we 1st started collectin thi
> information.
>
> I am wanting to create a form that anyone can go into and select a date
> range so that the can calculate the hours between these dates.
>
> Th other problem that I have got is that the date are in number format and
> not in date.  How dan I format this correctly? 

0
Allen
11/16/2007 9:54:46 AM
Reply:

Similar Artilces:

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

sort alphanumeric data
I have data with mix number of digits and I like to sort them. Somehow, the normal sorting process give me a not so desired result. Can anyone help? A10 B100 A2 AA1 AD200 A1 The result I am looking for is: A1 A2 A10 B2 B100 AD200 I think your example wasn't exactly right' look at the B2 and AA1 entries. But I assume you want to sort like the Excel row and column identifiers; I also assume there will be two alpha characters at most Go to the VB Editor (ALT+F11) Insert>Module Paste these two functions in the code window: Function PartOne(a As String) As String Dim i As Long For ...

move row data to columns
We had a problem with some test data and instead of test results being recorded in multiple rows 5 columns wide, all of the data was recorded in one row multiple columns wide. The data consists of 5 readings taken every second for a period of 2 hours. Each reading is in it's own cell (no cell contains more than one reading). Do you know of a way that I can move each set of readings (5 test results) into it's own 5 column wide row? i.e. currently shows in single row as: 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 234, 234, 234, 234, 234, etc. and I need in 5 column wide rows: 0, 0, 0, ...

date formatting problem: x axis
I have several chart files that are all the same except for one that seems to go back to a formatting problem. I can't remember how I fixed it last time, which was temporary anyway. Problem is this: I am using mostly end of year dates (12/31/94, 12/31/95, etc.) However on my x axis it shows Dec-94, everytime I try to reformat it to the correct format(xx/xx/xx), I get 12/01/94, 12/01/95, etc. Always the first day of the month instead of the last. I'm not having these problems with all the others similar files. The only difference I have seen between the files is the &qu...

How do I add the Last Date Revised in an Excel spreadsheet?
When I add the date, it changes each time I print. How can I add the last date revised in an Excel spreadsheet? Hi either enter this manually or you need VBA for inserting this date in an event provcedure -- Regards Frank Kabel Frankfurt, Germany "GrlNexDor329" <GrlNexDor329@discussions.microsoft.com> schrieb im Newsbeitrag news:5656928E-520E-4E0D-B17E-FF423BDBCF00@microsoft.com... > When I add the date, it changes each time I print. How can I add the last > date revised in an Excel spreadsheet? See Ron de Bruin's site for code. http://www.rondebruin.nl/print...

Pivot Table Data
This is a multipart message in MIME format. --=_alternative 006B899F86256E2F_= Content-Type: text/plain; charset="us-ascii" I have a file that contains pivot tables along with some buttons and macros to change the way the pivot table looks depending on what type of information that you would like to view. The pivot table is based on data on a separate worksheet but is within the same workbook (separate tabs). If I change my data source (i.e. I change the names of individuals to new names) and refresh my pivot table, the information changes like I want it to. However, if I de...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

UK Fantasy Football Player Data?
Hi, Does anyone know where I can get hold of excel spreadsheets with player data for the forth coming UK Fantasy Football season? -- Rich http://www.ukfantasyfootball.info ...

Search Key Not Found while searching in a form
I can search in a table using the "binoculars" with no problem. When I try to do the same in a form, I get the message "search key not found". How do I correct this so I can search in a form? -- Emperial Free Luminesce "blue10liberty" <blue10liberty@discussions.microsoft.com> wrote in message news:DE9EA5D0-B5D0-46F0-BA08-70FD646181BD@microsoft.com... > I can search in a table using the "binoculars" with no problem. When I > try to do the same in a form, I get the message "search key not found". > How do I correct...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

Data Type Problem
Hi Experts In VC++, the maximum range for data type is 10 bytes which is the range for long double __int64 has 8 bytes range. Is there any data type which has range more than 10 bytes? Is there any data type which has range 16 bytes If not supported, then can i create my own data type which range should be more than 10 bytes? if yes then please reply thanks If you need to play with huge sections of numbers, you can always use a unsigned char array, and use bit shifting backwards and forwards for calculation (complex). Otherwise, for numbers there are other string ba...

Form View
How can I get a form, based on a table, to show only certain records (for example, only paid customers)? I tried basing the form on a query but it didn't work. Thanks, Courtney That is the way you would do it. You can restrict the records that the form displays based on criteria in the query. Did you apply any criteria to the records in the query? You can also filter records in a form using the form's filter property By the way, it didn't work is not very descriptive and of very little help in diagnosing a problem and suggesting solutions. Did you get the wrong records, ...

NTFS file meta data
This is a multi-part message in MIME format. ------=_NextPart_000_008A_01CAFF1D.F88487D0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit How can I set the From, Subject, To properties of Outlook MSG files to display in a manner as EML files? I have folders of thousands of these files and would love to create a batch processors to do this. TIA Russ ------=_NextPart_000_008A_01CAFF1D.F88487D0 Content-Type: image/png; name="Capture.PNG" Content-Transfer-Encoding: base64 Conte...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Exporting Specification sets in FRX
I'm attempting to export my FRX 6.5 specification sets and am having issues. When I attempt to export any .F32, it shows that there are no Catalogs in the file. I've tried just about every .F32 file on my server and haven't found my reports. Am I going about this process wrong? I'm just going in to FRX, clicking on company and going to specification sets. Then I set the location text box to the proper F32 file. Any clues would be much appreciated! Jeff, I'm not sure if you can't find a report to export, or if once you export the file, you can't find it to imp...

Data from multiple sheets and workbooks
Each week I receive a workbook from one of my customers. It contains mutliple sheets with salesnumbers from all the branch of my customer. Each sheet contains from 1 000 to 15 000 lines of salesdata. Every article sold gets one line in the sheets. Each workbook are named "weeknr.xls" and are stored in the same folder. Now my question/problem. I need to gather all sales info for one branch on one article from all the weeks. I know how to get the data from one workbook to another, but how do I get it to scan all the workbooks in the folder. Any ideas. Dim oFSO Sub LoopFolder...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

Graphing only some of the data?
I have a spreadsheet with groups of repeating rows and cells that look something like this 1AA 1AB 1A 1BA 2BB 2B 1CA 1CB 1C 2AA 2AB 2A 2BA 2BB 2B 2CA 2CB 2C The rows/cells beginning with "1" make up one batch of data. The rows/cells beginning with "2" make up another. I add a new batch every week. I want to create a graph that captures only 1CC, 2CC, 3CC, 4CC, etc. There are always the same numbers of rows between the cells. I've thought about capturing 1CC, 2CC, 3CC, etc in a list in another area of the spreadsheet and graphing that list, but I don't ...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

Importing data 02-12-04
Does anyone know if you can import data into the cases? I know you can import into the contacts, but can you import cases? The Data Migration Framework should be able to do this. Gill >-----Original Message----- >Does anyone know if you can import data into the cases? I >know you can import into the contacts, but can you import >cases? >. > ...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

SOP Actual Ship Date
In SOP setup, we do not use a Separate Fulfillment process. So, I'm assuming the Actual Ship date defaults from either the system date or the order date on the date the order is created (because it's also fulfilled on that date). Is there any way that we can have the Actual Ship date default to the Invoice date at the time the order is transferred to an invoice? We're trying to get a SmartList that shows (by item) Order Date AND Actual Ship Date/Invoice Date. Is this possible some other way without SmartList Builder? Elaine, 1. Is there any way that we can h...

Can I add Java Data types in Microsoft Visio?
I want to design a UML diagram of a java application. Can i add Java data types in Microsoft Visio 2003? ...

Money 2004/05
I have recently purchased a new computer and installed Money onto the new computer (Money version says Copyright 2004, but I think it is 2005 version). I have then simply copied across the data files My Money Backup (Microsoft Money backup File) and my money backup2 (Microsoft Money file) to the new computer...For some reason I just cannot get Money to open the data files on the new computer. When I try to open the Money file, I receive the following message; "Money will convert your file so that you can work with it in Money. First, Money will make a copy of your original file, ...