Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Query

Status
Not open for further replies.

fogal

Technical User
Aug 20, 2001
87
US
I have a query with 2 fields as shown below:
I want to create a new field (Field3) to do as shown below.
Field1 Field2
GroupA A1
GroupA A2
GroupA A3
GroupB B1
GroupB B2
GroupB B3
GroupC C1
GroupC C2
GroupC C3
I want my query to display a new field, don’t mind if it is done from a new query:
NewField3:
GroupA
A1
A2
A3
GroupB
B1
B2
B3
GroupC
C1
C2
C3

I have just used sample data to give everyone an idea of what i'm trying to do.
 
Doing this in a report structure, rather than a query, would be very easy.
Create a new report setting its recordsource to your initial query.
In the report, in the View - Sorting and Grouping section, select Field1 from the Field/Expression list and make sure the Group Header is set to Yes.
Close the window.
In the report, move Field1 to the Field1 Header and Field2 to the Detail section.
You may need to resize the header and detail sections to make it look like you need it to.
Preview the report.

I hope this helps you.
 
Unfortunately, I need to do this in a query. I plan to export the query to a text file using access xp. I have this working in a report, as you stated but when I export the data to text, it misses some of the text in the export. It works fine from access 97. I now believe the ebst way to do it is from a query.
 
Why can't you export the report to a text file in the format you want?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top