473,406 Members | 2,345 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,406 software developers and data experts.

best way of doing a double query?

i have a query which pulls the information for specific event, and pulls all the other information into one form to send to client to confirm. which all works fine.

But then I came across a problem where some events can run over 2 or more days, but dont want to give them multiple sheets for each day. What is there best way to do a query and then pull the data from day1 and then day2?

i cant think around how to do it? or what the best way of doing it would be etc... any thoughts?
Jul 12 '16 #1

✓ answered by sheepchild

apologies i keep forgetting.

I think i have come up with a solution which works and helps for other things as well. I have got a query that now searches on date and title, so i can do it for a specific course, even if it spans 2 weeks. Also allowing me to do the same for the year etc.. as the data would be quite useful.

11 985
PhilOfWalton
1,430 Expert 1GB
Tad short of information, but haven you considered grouping your report by date?

Phil
Jul 12 '16 #2
Currently the query for the report goes from which event is open in the form.

Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_Bookings.*, tbl_technical.*, tbl_Bookings.EventID
  2. FROM tbl_Bookings LEFT JOIN tbl_technical ON tbl_Bookings.EventID = tbl_technical.[Event ID]
  3. WHERE (((tbl_Bookings.EventID)=[Forms]![frmEventDetails]![EventID]));
Jul 12 '16 #3
PhilOfWalton
1,430 Expert 1GB
Assuming the event contains a FromDate and a ToDate then try grouping on the ToDate

Phil
Jul 12 '16 #4
have grouped on the date but, i think its the initial way i have set it up. as its only for one eventID, only pulls one record through.

just thinking aloud is there a way of, having a dynamic query where you can select which ones you want going through? so i could pick from a date range and then choose the ones from that which i want to do the report from?

Or say if the from the eventID say look for same event name including "day 2"?

sorry for the real vagueness on this kind of at a road block in this and dont know where to go to the next stage or to over come the problem.
Jul 13 '16 #5
PhilOfWalton
1,430 Expert 1GB
I am unclear.
Does one event have different details for the two different days? If so, to my mind it's 2 events. Those 2 events could be places with a single booking though.

Need to see some table structures.

Phil
Jul 13 '16 #6
event name, will be the same but it will have a different ID as catering and other items could change day to day.

layout is attached

Attached Images
File Type: jpg layout.jpg (75.8 KB, 210 views)
Jul 14 '16 #7
PhilOfWalton
1,430 Expert 1GB
I think you've answered your own problem.

There should be a "Master Event" table and the TblBookings table should have an additional field MasterEventID linked to the MasterEvent table

Expand|Select|Wrap|Line Numbers
  1. TblMasterEvent
  2.      MasterEventID     Auto
  3.      MasterEventName   Text
  4.  
The EventTitle would probably no longer be required.

Your forms & reports would be based on the MasterEvent table, and the Events(Bookings) would be subforms and subreports.

Phil
Jul 14 '16 #8
not quite sure how that would integrate into the current calendar of events that i have, which has been altered from another Db.

Attached Images
File Type: jpg main window.jpg (66.4 KB, 169 views)
Jul 14 '16 #9
PhilOfWalton
1,430 Expert 1GB
The other alternative is to use the EventTitle as the filter on which you base your forms & reports, but this is strongly discouraged as you
a) have to ensure the event title is identical for the same event run on 2 consecutive days and
b) That event title is NEVER used again.

Without seeing your database, it is difficult to see what the ramifications are, but you are saying in practice, you have 2 separate events, and the only thing in common is that they were booked for the same person and that they have the same name. I would be very surprised (and disappointed) if the same menu was served up both days.

I know it means a radical re-think... sorry

Phil
Jul 14 '16 #10
zmbd
5,501 Expert Mod 4TB
Phil, based on Sheepchild's other threads, and the image in post#9, I suspect the root database is
home > topics > microsoft access / vba > insights > ms access calendar - overview

This is ADezii's baby and he may be the best person to help here if this is the case. :)

@Sheepchild
You really need to point to Adezii's database if you need help, even with this mod, so that we have a reference point. The quality of your information you provide is going to dictate the quality of the answers we can provide and the length of time it takes for us to help you resolve the situation.
Jul 16 '16 #11
apologies i keep forgetting.

I think i have come up with a solution which works and helps for other things as well. I have got a query that now searches on date and title, so i can do it for a specific course, even if it spans 2 weeks. Also allowing me to do the same for the year etc.. as the data would be quite useful.
Jul 18 '16 #12

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

Similar topics

13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
6
by: Christopher C | last post by:
I am currently working on an app the will be a shell replacement. Part of the goal is to list the current network status; basically I need to know if the network card is plugged in. I am currently...
2
by: DC Gringo | last post by:
I have two dropdownlists where one is a set of districts and the other sub-districts. Upon choosing a district in the first dropdownlist, I need the relevant subdistricts to show in the second...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
0
by: priyankas | last post by:
I am getting this error when doing a SELECT statement . COM.ibm.db2.jdbc.DB2Exception Message is: CLI0 :109E String data right truncation. SQLSTATE=22001 Can anyone help me out with this?
3
by: Alexander Higgins | last post by:
Hi, I am working on an NNTP Client via windows forms and am actually try to login into this group to no avail. I am sending AUTHINFO USER username <where username=myemail address AUTHINFO...
0
by: shorti | last post by:
I am working on a few queries that require comparing data from several tables. I was curious if anyone had any suggestions on ways to get the best performance. Here is an example: table1...
5
mikek12004
by: mikek12004 | last post by:
doing a (not so simple) query -which works fine in sql server using PDO like this: // attempt a connection try { $pdo = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.