473,513 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Queries criteria using an integer as the output

4 New Member
I have information like so

ID# Field1

1 Cariene Jawors
2 123 Sesame St
3 Tampa, fl 33634
4 cariene@aol.com
5
6 John Doe
7 123 Big Bird Row
8 Tampa, FL 33634
9 john@doe.com

ect.


It is in rows excatly as above. All my other db info is in columns. I need to change the information to column entrys.

I have been trying to write a query that calls for every 5th id# starting with id #1. I am quite lost as how to write and retrieve the info.
Any help would be greatly apprieciated.
Aug 22 '07 #1
7 1451
Rabbit
12,516 Recognized Expert Moderator MVP
This is definitely the wrong way to store data.

If you are certain that the entire dataset is in this format then you can use the mod operator to bring the information into columns.

ID# mod 5 = 1 is the first line of information
ID# mod 5 = 2 is the second line of information
and so on.
Aug 22 '07 #2
mlcampeau
296 Recognized Expert Contributor
I have information like so

ID# Field1

1 Cariene Jawors
2 123 Sesame St
3 Tampa, fl 33634
4 cariene@aol.com
5
6 John Doe
7 123 Big Bird Row
8 Tampa, FL 33634
9 john@doe.com

ect.


It is in rows excatly as above. All my other db info is in columns. I need to change the information to column entrys.

I have been trying to write a query that calls for every 5th id# starting with id #1. I am quite lost as how to write and retrieve the info.
Any help would be greatly apprieciated.
Instead of having a new row for the name, address, and email address you should have your table set up with the following fields:

ID#; Last Name; First Name; Address; City; State; ZipCode; Email

so your output would look like:

1; Jawors; Cariene; 123 Sesame St; Tampa; FL; 33634; cariene@aol.com
2; Doe; John; 123 Big Bird Row; Tampa; FL; 33634; john@doe.com

This setup will make your life waaaaaaaay easier!!!
Aug 22 '07 #3
cariene
4 New Member
All my other data is set up in colums with headings. This is new data given in this format. I cannot import it untill it is modified.
Aug 23 '07 #4
cariene
4 New Member
I have read alot today trying to find all I could on the mod operator. I do simple db work and am not understanding any of the macro information yet. Fourtunatly I do know how to write some sql queries but I could not understand if I should use this mod operator in a simple access query, macros, or SQL view.

When I have tried to use it in access, I cannot. I am getting that i cannot use the asteric, in criteria.

My data has under one field (or row) 655527 entries, so i must changed it numerically. If some one could tell me, should I be writing this in an access query or a macro ect. That also would be helpful.
Aug 23 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
1 Cariene Jawors
2 123 Sesame St
3 Tampa, fl 33634
4 cariene@aol.com
5
6 John Doe
7 123 Big Bird Row
8 Tampa, FL 33634
9 john@doe.com

If this is how your data is set up through and through. Then you can set it up over 5 SQL queries. Using mod to select the correct rows, \ to set up a key, and a join query to connect them all.
Aug 23 '07 #6
cariene
4 New Member
Thank you very much. I really appreciate it. Cariene
Aug 28 '07 #7
Rabbit
12,516 Recognized Expert Moderator MVP
Not a problem, let us know if you have any questions.
Aug 28 '07 #8

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

Similar topics

6
2109
by: Brad | last post by:
I have an sql query that has specific criteria (like state='PA' or state = 'NJ'...) and would like to be able to have the user specify the criteria dynamically either through the web or from...
1
3394
by: Aaron | last post by:
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; ...
12
6338
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
1
1556
by: Bert_Belgium | last post by:
Hello, I created a database containing several queries on 1 table giving as output the number of records who met certains criteria (= warnings). 1 "grouping" query has as input all the queries...
0
3306
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
2
1495
by: MLH | last post by:
Why does this one produce 9 records... SELECT DISTINCT tblVehicleJobs.VehicleJobID, tblVehicleJobs.Reclaimed, tblVehicleJobs.VSaleID, tblVehicleJobs.ENF262Written FROM tblVehicleJobs WHERE...
10
2554
by: john | last post by:
I have a report to print envelopes. The report is based on a query. Now I need to make 10 more queries to make different selections of addresses. Every query has the same output fields as the...
5
2240
by: EricS | last post by:
Hi, Was wondering if anyone can help. I have multiple queries in a database. The selection criteria for these queries is always a time period I want to do the analysis by. Rather than having to go...
2
2246
by: MLH | last post by:
Consider having tblCorrespondence, then copying & pasting it to tblCorrespondence1 - such that they are identical. Then consider the following UNION SELECT statement... SELECT...
5
8082
by: Brett | last post by:
Hello, Is it possible to have just one criteria and have it apply to a group of queries? I am trying to create a report with the separate results of 4 queries based on a prompt for the user...
0
7171
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
7551
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...
1
7115
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
7542
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...
0
5694
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
464
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...

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.