473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Enquiry code: showing records within a period

1
I having a table something like this:

startdate | stime | endate | etime | tool
3/3/07 | 8:47 | 3/4/07 | 00:30 | A
3/4/07 | 3:57 | 3/4/07 | 4:30 | B
3/4/07 | 8:21 | 3/4/07 | 9:20 | C

Currently I have a form which use to open daily1 form.
I have one textbox[date] for enter date and a button to view.
Is it possible if I want enter 3/4/07 on the text box
it will give me the records from 3/3/07 7:00 till 3/4/07 7:00
(thus, only show tool A and tool B)

my currently event procedure for the button is below:

Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2. Dim strWhere As String
  3.  
  4. If Not IsNull(date) Then
  5. strWhere = strWhere & " AND startdate = " & "#" & _
  6. date & "#"
  7.  
  8. If Not IsNull(strWhere) Then
  9. strSQL = Mid$(strWhere, 6)
  10. End If
  11.  
  12. strForm = "daily1"
  13. DoCmd.openform strForm, , , strSQL
Anything can be modify on the code in order to search the records base
on the time interval?
Thanks =)
Mar 20 '07 #1
1 1305
MMcCarthy
14,534 Expert Mod 8TB
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Dim strWhere As String
  2. Dim strForm As String
  3.  
  4. If Not IsNull(date) Then
  5. strWhere ="startdate=#" Me!date - 1 & "#" & _
  6.    " AND stime >= 7:00) OR (startdate=#" Me!date & "#" & _
  7.    " AND stime <= 7:00) "
  8.  
  9. strForm = "daily1"
  10. DoCmd.openform strForm, , ,  strWhere
  11.  
Mary
Mar 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dale Ring | last post by:
Sorry about the dup post, somehow my original post was put on an existing thread instead of a new one. Access 2000 I am working with a service call database and would like to create a query...
1
by: kenduron | last post by:
Hello together! How would you manage the following termin: I got table "A" and table "B" I have to show most of the fields in "A", an one columm in table "B". But table "B" can have...
17
by: Liam.M | last post by:
Hey guys, Forgive me if my question my be alittle silly, but I would very much appreciate and assistance that could be given! My situation is as follows: I have created a Button, and set...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
4
by: georges the man | last post by:
hey guys, i ve been posting for the last week trying to understand some stuff about c and reading but unfortunaly i couldnt do this. i have to write the following code. this will be the last...
2
by: punitshrivastava | last post by:
Hi to All. I am Punit Shrivastava.I am working in Asp.As i am new in this technology please help me. I want to create enquiry form in Asp. For this i code like this: <form name="enquiry"...
1
by: dianatokatlidis | last post by:
Hello. I have 2 separate date fields in a query. One is called Effective_Date and the other is called Expiry_Date. I want to compare the time period between these 2 fields and select any records...
4
by: Thomas Arthur Seidel | last post by:
Hello to all, I have a small or big problem with a customer data base, where during a change of system we might have created duplicate records. This should be easy to find, you might think, but,...
5
by: vamsioracle | last post by:
Hi all, I have a problem with the ult_smtp package. Let me explain how the structure of my code is procedure------------ begin declarations of variables and cursors...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.