473,791 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query on Dates to Collect All Data on Same Day

3 New Member
I have been tinkering with this for a while now, and I just can't get no satisfaction!
I need to create a query which pulls from a table that has three columns: Date, Task and Comment. The final output is to a pane in a month-to-view calendar. Right now, the data might come out a bit like this:

June 1, 2007[ ]Los Angeles, Mexican Eatery[ ] This will be a worthwhile venture
June 2, 2007[ ]Similar task - set a poem on a backdrop of Galicia [ ] Good, too
June 2, 2007[ ]Hermosa Beach - Jazz Party[ ] Set to music?
July 1, 2007[ ]Hidden Hills, CA - Bikers Romp[ ] We'll give this a miss
July 7, 2007[ ]Some other location, something else[ ] Rock Concert

The [ ] are what I have used to illustrate the columns. What is happening now is that for a date where there are two events on the same day, my output is showing two days: i.e.: there are two June 2, 2007's in my calendar. So, consequently, there are going to be two Saturdays.

What I really want to do is to create a query which takes the date, merges the data all on to one line, preserving the order of Tasks and Comments, and delimiting the data with a symbol, any symbol - it doesn't matter, just so long as the event are separate. Both Task and Comment are memo fields. I have so far managed to pipe into the memo field carriage returns and line feeds, so the data actually looks well formatted where it is displayed. However, the major show-stopper (!) is the fact that I cannot reprocess the data so that the stuff that happens on the same day appears one underneath the other in an ordered column. Any help gratefully received...
Best,
stevetuf
Jul 6 '07 #1
4 1329
breadhead
4 New Member
Steve,

What you're describing seems like a task for a do...while loop, not a query. If you're not restricted to queries, I think the right approach might be to create a pair of recordsets - one for the dates and another for the individual records for each date, then loop through the second recordset a row at a time, writing the text to a variable and updating the table at the end of the recordset.

All that being said, I have an open thread where I'm struggling with a recordset, so this advice is worth only what you've paid for it.

Good luck, Mark


I have been tinkering with this for a while now, and I just can't get no satisfaction!
I need to create a query which pulls from a table that has three columns: Date, Task and Comment. The final output is to a pane in a month-to-view calendar. Right now, the data might come out a bit like this:

June 1, 2007[ ]Los Angeles, Mexican Eatery[ ] This will be a worthwhile venture
June 2, 2007[ ]Similar task - set a poem on a backdrop of Galicia [ ] Good, too
June 2, 2007[ ]Hermosa Beach - Jazz Party[ ] Set to music?
July 1, 2007[ ]Hidden Hills, CA - Bikers Romp[ ] We'll give this a miss
July 7, 2007[ ]Some other location, something else[ ] Rock Concert

The [ ] are what I have used to illustrate the columns. What is happening now is that for a date where there are two events on the same day, my output is showing two days: i.e.: there are two June 2, 2007's in my calendar. So, consequently, there are going to be two Saturdays.

What I really want to do is to create a query which takes the date, merges the data all on to one line, preserving the order of Tasks and Comments, and delimiting the data with a symbol, any symbol - it doesn't matter, just so long as the event are separate. Both Task and Comment are memo fields. I have so far managed to pipe into the memo field carriage returns and line feeds, so the data actually looks well formatted where it is displayed. However, the major show-stopper (!) is the fact that I cannot reprocess the data so that the stuff that happens on the same day appears one underneath the other in an ordered column. Any help gratefully received...
Best,
stevetuf
Jul 6 '07 #2
garethfx
49 New Member
I understand the query - no problem

Why not output to a report where you can group on date. Makes the job so simple

and ease to do in second

gareth
Jul 6 '07 #3
stevetuf
3 New Member
Steve,

What you're describing seems like a task for a do...while loop, not a query. If you're not restricted to queries, I think the right approach might be to create a pair of recordsets - one for the dates and another for the individual records for each date, then loop through the second recordset a row at a time, writing the text to a variable and updating the table at the end of the recordset.

All that being said, I have an open thread where I'm struggling with a recordset, so this advice is worth only what you've paid for it.

Good luck, Mark
Thanks Mark
I will try and use this approach, although, as you can see, it may be as simple as outputting it to a report (suggested by Gareth.) Whether I can fit each day's report into the date panes will be another matter though... I think your approach looks like the more elegant solution. I didn't really understand what you meant by "...this advice is worth only what you've paid for it." I pay a monthly subscription to Experts Exchange and frequently find that the responses to users' questions are not only dumb - they show remarkable lack of focus on the problem...! (Maybe I am not asking the sort of questions that produce the most elegant Experts Exchange answers...! LOL) What are you struggling with? Perhaps I can help?
Best,
~Steve
Jul 10 '07 #4
stevetuf
3 New Member
I understand the query - no problem

Why not output to a report where you can group on date. Makes the job so simple

and ease to do in second

gareth
Hi Gareth
Thanks for your answer. I have a feeling that putting each date's values into a separate report might be a tad too complicated... (Since there are no attachments or graphics in a text forum such as this, I can't really illustrate it sufficiently to show you why I don't think this would work...)
But I appreciate your response.
Best,
~Steve
Jul 10 '07 #5

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

Similar topics

8
7591
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I want them to do as little as possible when they run their reports. I have a crosstab query that displays usage of items for each month. It looks pretty much like this: ITEM DESC UM 12/02 1/03 2/03 3/03 ...ETC. 1 Solution ...
8
17224
by: Bill | last post by:
Hello out there; This may be a challenge but I'm certain it's possible but I can't seem to figure out how. I have a table that has several date fields, e.g., Date1, Date2, Date3, Date4 ... etc. I wish to find out either of two things for each row. 1) What is the maximun date in any of the date fields in the row.
2
6517
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result. I then want to search through the records and select those with dates (as caluclated above) within a user defined range, and so I am using a parameter query. However, this query returns dates outside of the range and appears to have particular...
1
2766
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I have a table containing records for each job done, the records contain date, employee name, job done (a code representing the type of job), cost code (another code), regular hours, and overtime hours. The tricky part is that more than one job can...
1
5973
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day and display it in a query with each day's date along the top row and the data items below it. This would give a better appreciation of changes over time. I apologise if I'm missing something obvious. Phil
2
5739
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and icluding the selected date or all records on or after the selected date The user selects either "=", >=" or "<=" from a combo box and then a date from another combobox. The combination of thse two choices is then set in an unbound textbox so...
5
2172
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the date from Table 1 into
2
4235
by: dauwe.peter | last post by:
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr, cddatein, cddateout, dvd nr, dvddatein, dvddateout. I would like a query where a see the personsname en de last book with the datein and out , the last cd with datein and out , and the same for the dvd. Because the last time the person came he toke only a book but dit not return his dvd (for example). But with one click i would like to see the last of every item with the...
17
1765
by: R.Rafii | last post by:
Hi, I have a simple (?) question for you all experts. I have a button that performs a query on my SQL and fill a datagrid on the form The code: Dim sconn As New SqlConnection() sconn.ConnectionString = "Data Source=(my.Server;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=Mypass" Dim filterresults As New SqlDataAdapter("Select * from contacts ", sconn)
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.