Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Microsoft Access
»
Microsoft Access
»
Incremental Number
15 posts, Page 2 of 2
««
1
2
Incremental Number
Rate Topic
Display Mode
Topic Options
Author
Message
Sean Lange
Sean Lange
Posted Friday, November 30, 2012 3:12 PM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 2:33 PM
Points: 8,620,
Visits: 8,261
sasansamani (11/30/2012)
SELECT DMax("[AssetNumber]","Waste Hauler Number","+1") AS Expr1 FROM [Waste Hauler Number];
I am getting two 4001. What I am doing incorrectly?
The last parameter is the criteria (it acts like a where clause). "+1" is not valid there.
Personally I hate those built in functions. I find them obtuse and difficult to read.
I would write that as a query instead.
select MAX(AssetNumber) + 1 from [Waste Hauler Number]
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1391572
sasansamani
sasansamani
Posted Friday, November 30, 2012 3:20 PM
SSC Rookie
Group: General Forum Members
Last Login: Friday, January 11, 2013 11:52 AM
Points: 28,
Visits: 50
thank you very much. It works now.
I tried to use something simlar to that.
Post #1391574
Sean Lange
Sean Lange
Posted Friday, November 30, 2012 3:30 PM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 2:33 PM
Points: 8,620,
Visits: 8,261
You're welcome. Glad that worked for you.
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1391577
ProofOfLife
ProofOfLife
Posted Saturday, December 01, 2012 3:30 AM
SSC Rookie
Group: General Forum Members
Last Login: Thursday, February 21, 2013 9:11 PM
Points: 45,
Visits: 9,440
Hi
My apologies for not being able to contribute to this earlier - I'm fairly certainthat I am in a different time zone to you.
If you are wanting to do this in an Access query, then you could use a LEFT OUTER join. Join the table with the incrementing number to the table you wish to check via the two number attributes, then set the join type to the left outer join option (2).
If you create a test query in this way (Important Note: drag your join from the table with the incrementing number to the table you wish to check) and simply add the two attribute, you will see matching numbers where you have used the number and the incrementing number and a null in the cases where the numbers haven't been used.
Taking this a step further, add a null criteria for the attribute in the table you are checking, and you will be returned a set of numbers that haven't been used. You could then use this as a subquery for generating the next unused number by changing the query to a group (aggreagte) query and use the min option.
Cheers
Rowan
Post #1391638
sasansamani
sasansamani
Posted Saturday, December 01, 2012 4:01 PM
SSC Rookie
Group: General Forum Members
Last Login: Friday, January 11, 2013 11:52 AM
Points: 28,
Visits: 50
thank you everyone
Post #1391675
« Prev Topic
|
Next Topic »
15 posts, Page 2 of 2
««
1
2
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.