TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahsan ashfaq
NA
14
0
Max() in sql server 2005
Jul 14 2010 1:31 AM
Hello all,
Thanks for reading my thread,
let me brief you first. I have a table "
Activity_id
"
and in the table i have a column name "
activity_id
" nvarchar(6)
it just contains Serial No.s from 1 to 201.
Now the issue.
select max(activity_id) from activity_id
This query returns value
"99"
which is incorrect.
select max(cast(activity_id as int)) from activity_id
This query returns the value
"201"
. which is correct.
I can reckon that its because of nvarchar and casting to int. but will u plz elaborate how nvarchar values are compared so that 99 is greater than 201.
Thanks,
Ahsan Ashfaq
Reply
Answers (
1
)
How to convert string to System.Drawing.Printing.PrintDocument?
Error In The Application OF Uploading Image Into Database