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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create an Autonumber Column in QBE?

Status
Not open for further replies.

CptCrusty1

Programmer
Feb 17, 2005
216
0
0
US
Is it possible to create a query in QBE where one of the columns is an autonumber?

RK
 
Yes. What kind of query are you trying to create?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I have a years worth of data from NOW()-365 through NOW() to give me a running total. The table is created every time the database is opened.

I need to show a running total by month of a given set of criteria, i.e.,
MIN(Month and Year) had X Widgets
MIN(Month and Year)+1 had x Widgets
ETc. etc.
This will start to have problems when I get to the 12th month since the code will start getting long, the year will change, yadda yadda yadda. I figure, I'll create a query from the table that grabs the MonthName, and the Year. I can concatenate them for display purposes, however, if I have a autonumber feature, ie. 1.2.3.4.5..... than Month 1 can be January, but can also be May since the query will repopulate everytime the database opens. Doing this, I think I'll be able to tell the text box:

dcount(Widgets, from tblWidgetTable, .....) This is as far as I am so far with this. Does this help any?

RK
 
If your table is always one year of data:
Code:
Select DatePart("yyyy", [OrderDate]) as SortYear, DatePart("mm", [OrderDate]) as SortMonth, Sum(Widgets)
from table
group by  DatePart("yyyy", [OrderDate]), DatePart("m", [OrderDate])

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Sorry - that doesn't get a running total, jsut the individual months.
 
I have to put this aside for now. I"ll come back to your spiffy comments later....

Thanks for the help tho..

RK
 
Is there a way to make a report/form in datasheet view fill in from left to right instead of from Top to Bottom?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top