Own Forum - Number Of Posts And Stars/ranges - How To Make It ???

Oct 27, 2006

So I have simple forum. At main page I have gridView which display topics. When I go to topic #5 (for example) I use repeater to display posts and authors. Here is a code:
 
SELECT aspnet_Users.UserName, forum_posts.post_id,
forum_posts.post_content, forum_posts.topic_id, forum_posts.post_date
FROM aspnet_Users
INNER JOIN forum_posts
ON aspnet_Users.uID = forum_posts.user_id
WHERE (forum_posts.topic_id = @topic_id)
 
Now I have a problem - how can I display with each user his number of posts - eventually how can I display for example if he has 25 posts - one star, 50 posts - two stars, or maybe display "Starter" range, etc. How to make this, cause I don't have any idea. 

View 9 Replies


ADVERTISEMENT

What MS SQL Data Type Should Be Used For Storing Things Like Forum Posts ?

Mar 31, 2008

Let's say a user profile page on a website contains a description about a car that the user wants to sell.  The user could try to be wise and write something very short like "buy my car" or the user could write a very lengthy description of his car to convince the buyer to make the purchase.
Or somebody creates a thread in a forum or replies to a topic (much like what we do here).
In these instances, what is the most efficient manner of storing the high-character content in these examples with SQL Server 2005?  Keep in mind that a user could make a 2-character post like "OK" or could write a long reply or create a huge profile.  So the data type has to be efficient and flexible.  Judging from the list of available types in my Express 2005, I would guess the varchar(MAX) or the text data types could be used.  Or would I use some other data type?
TIA.

View 4 Replies View Related

SQL Server 2012 :: How To Find Continues Number Ranges

Dec 19, 2013

Consider the following data

create table #sampletbl
(
Category varchar(100),
Numbers varchar(100),
Status varchar(100)
)
insert into #sampletbl values ('A','29710000001','0')

[code]....

if status = 0 then unused status = 1 then used

i need to find 10 continues unused numbers

This is the sample data. In live I'm having plenty of data like that . So quite complex.

note : In real world I need to find the 1000 continues number ranges.

View 8 Replies View Related

How Do You Strip Off Stars

Feb 26, 2004

I don't know how the stars are attribuated
but I don't think I should have so many
It gives a false impression to new members

View 3 Replies View Related

Make To Look Like A Telephone Number

Aug 29, 2007

I have a column that has telephone numbers that look like 90939067440000

I need them to come out looking like
(###)###-####x###
I have no idea where to begin

View 7 Replies View Related

Transact SQL :: Replacing Names With Stars

Oct 30, 2015

I'm struggeling a bit with this one, goal is to show the first 3 characters of the name and replace the remaining characters with *** stars. Also the number of stars needs to match the lenght of the name as in the example above.I've tried:

REPLACE([ColName],
substring([Colname],
4,
LEN([colname]
)),
'*')

View 5 Replies View Related

How Do I Make The Field A Number Data Type?

Feb 8, 2007

Hi there!
I'm using a Switch statement in my SQL as follows:

Code:

SELECT symbol,
Switch(timestamp Is Null,Null,
timestamp <= 005959, 0,
timestamp<=235959,23) AS period
INTO averageprice
FROM stocktrades;




Now here's my problem. The Data Type stored in the 'period' field of this new table I've created, dubbed averageprice, is a Text field and I want it to be a Number field. I've tried my best to figure this out and I'm still looking so any helpful hints or solution would be greatly appreciated. Thanks!!!

View 1 Replies View Related

Transact SQL :: How To Make Phone Number In A Regex Pattern

Oct 27, 2015

I am learning the string functions and the database that I'm using is AdventureWorks2012.However ,while practicing I was just trying to hide the phone number with '*' mark,but not getting the desired result.So the code is.............

SELECT
             PhoneNumber,  (SUBSTRING(PhoneNumber,1,2)+REPLICATE('*',8)+
             SUBSTRING(PhoneNumber,CHARINDEX('[0-9][0-9]{1,2}',PhoneNumber),LEN('-555-01')))AS[PhoneNumber]
 FROM
             Person.PersonPhone

[code]....

View 6 Replies View Related

How To Make Footers Page Number Appear When I Print The Report

Jan 10, 2007

I have the footer with the following in it,

**********************************

= " Page " & Globals!PageNumber & " of " & Globals!TotalPages & " " & String.Format(Globals!ExecutionTime, "dd-MM-yyy uu:mm")

********************************

When i view the report it shows the page number and time, but when i print it does'nt appear at all on the print paper( page number and time)

is there a trick to make it appear on the print.

Thank you very much.


View 2 Replies View Related

SQL Server 2014 :: Adding Alphabet To A Number To Make It Unique

Nov 25, 2013

create table #temp_Alpha_num (
[uniquenum] [int] Not NULL,
[Somenum] [int] Not NULL,
)
Insert into #temp_Alpha_num(uniquenum,Somenum)
values
(1,121)

[Code] ....

For the somenum column I need to add alphabets to make them unique. for example

121a,121b,121c....121z,121aa,121ab,101a and so on...

View 4 Replies View Related

SQL 2012 :: Populate Number With Leading Zeros To Make It As 5 Digits

Jan 23, 2015

Logic:ensure the Docket number is 5 digits and populate with leading zeros if not.I have to check input number field is 5 digits, if not I have to populate with leading zeros to make it as 5 digits.

View 2 Replies View Related

How To Make A Table To Display Perticular Number Of Rows Per Page??

Nov 29, 2007

Hi,
Can anybody tell how to ristrict the number of rows per page in SSRS?
I have a table in my report.I know we have to use" =Int(RowNumber(Nothing)/25)" in group expression.But I already have 3 group expression in my table.Where to write??
Thanks.

View 9 Replies View Related

Transact SQL :: Best Way To Make A Function For Summing Arbitrary Number Of Times Values

Jun 22, 2015

How is the best way to make a function for summing an arbitrary number of times values (table parm?)- I 've read it's necessary to convert to seconds, sum then convert back, but Im' wondering if there's an alternative.

Here's the example I want to sum:
00:02:01:30
00:01:28:10
00:01:01:50
00:06:50:30
00:00:01:50

View 8 Replies View Related

Reporting Services :: Make Bar Chart Color Red If Number Is Negative And Green If It Is Positive?

May 27, 2015

I have a 2012 report builder chart that has two series (one area chart and one bar chart) combined into one chart.  The problem I'm having is the bar chart has much smaller numbers than the area chart and the scaling is messed up.

Is there any way to put the bar chart on the right axis and keep the area chart on the left axis?  My goal is to increase the size of the bar chart in relation to the area chart.

Also, is there any way to make the bar chart color red if the number is negative and green if it is positive?

View 4 Replies View Related

Swallowed Posts

Feb 17, 2007

is something wrong with this webite or is it moderated?

i have tried 5 times to post and it never appears. i just get a brief message flash after posting that says 'if xxxx has chosen to moderate.... you will be taken to that thread' then i go to that thread. no post.

if i resubmit, i get '...duplicate post in last 5 minutes' - if it's duplicate, where is the post? this forum is becoming too frustrating for me to use.

View 5 Replies View Related

Query For No Of Topics & Posts

Jun 12, 2008

I need query to fetch values of postedname,repliername,categoryname,no of topics,no of posts from the 4 tables mentioned below.

tablename----categorymgmt
fields----categoryid,categoryname,categorydesc

tablename----forum_topics
fields----topicid,categoryid,topic,userid,description

tablename----from forum_reply
fileds----replyid,topicid,userid

tablename----usermgmt
fileds----userid,username

View 16 Replies View Related

Katmai Questions / Posts?

Jun 6, 2007

Where are we suppossed to ask questions about Sql Server 2008 (Katmai)? The connect site points people to the Sql Server forum here.



Wally



View 1 Replies View Related

Get Last Posts Of A Group Users

Sep 11, 2007



Hello dear coders

I have two tables (Members and Blogs)

I want to get the last posts of my user group 2 for each user i want to see this sentences

i-developer : last post on 5 May 2007 at 3.55 am
kingalone: last post 0n 6 June 2007 at 400 am

so i tried a lot of sql queries but none of them succed

my codes are;




SELECT Members.Username, Blogs.IsPublished, Blogs.PublishedDate

FROM Members INNER JOIN

Blogs ON Members.MemberID = Blogs.MemberID

WHERE (Members.RoleID = 2)

ORDER BY Blogs.EntryID

group by Username

select Max(EntryID),MemberID from Blogs where RoleID = 2

with FilteredLastPost ( MemberID,EntryID,PublishedDate)

as

(

select MemberID,EntryID,PublishedDate from Blogs where IsPublished = 1 and MemberID in( (select MemberID from Members where RoleID = 2)) order by EntryID desc, MemberID asc

)

select MemberID from FilteredLastPost

select distinct Blogs.MemberID,EntryID,PublishedDate from Blogs

right join Members on Members.MemberID = Blogs.MemberID

where not PublishedDate ='' and IsPublished = 1 and Members.RoleID = 2

order by EntryID desc, PublishedDate desc









select DISTINCT MemberID, EntryID, PublishedDate DISTINCT IsPulished from Blogs where IsPublished = 1 and not PublishedDate ='' and MemberID in ( select MemberID from Members where RoleID = 2 )

View 3 Replies View Related

The Posts Should Not Be Older Then 2 Months In Database

Jan 28, 2008

Is it possible to send a email after a certain date has pass by. And 2 days after the email has been sent the post should be removed if the member doesn't answer the message.
example: The posts should not be older then 2 months. When they get older than 2 months the SQL-Server detects this post and sends a messegae to the member if he wants to renew it. If he ignors it for 2 days after the email the post will be removed from the database. (Some posts have images also, They should also be removed from the harddrive)
Is this possible in MSSQL-Server to send email?
If someone could tell me how to create this.

View 6 Replies View Related

Need Help For Selecting Posts In SELECT Statment

Dec 4, 2007

I'll try to explane what I am looking for.

I'd like to select from a table, let say with 2 variables. One with a currency and one with integer. The integer value is a number between 0 and 255. The integer value represents a value of what kind of BIT is turned on in one BYTE.

Down to business.

I am looking for all BYTES with the fifth BIT = 1 as in example 00001000.This represents the value of 16. This value is an integer in my table. But as you see, the BYTE has a number of different values with the fifth=1 as the rest of the BITS can be 1 as in example 01011000 = 26.

Down to code.
Tablename = myMoney
Column Name = mCurrency; Data Type = decimal(18,2)
Column Name = bit5; Data Type = int





Code Block

SELECT sum(mCurrency)
FROM myMoney
WHERE somefunction(bit5) = 1





I have made the code in VB some time ago but this time I need to do the aclculation in the SQL server.

Hopefully Robin M

View 1 Replies View Related

Counting Posts Of Individual Months

Apr 17, 2008

Hi !
i am developing feature like blogs where a user posts but what i am looking for a stored procedure which could count that how many post were made in a particular month like

jan2008 (3)
feb2008 (8)

so any one could provide me helping link....

View 9 Replies View Related

Unzipping A Zip File-The Magic Number In GZip Header Is Not Correct.Make Sure You Are Passing In A GZip Stream.

Jan 25, 2007

I have the following code in an SSIS package and I get the following error:

Error: 0x0 at Unzip downloaded file, Boolean ReadGzipHeader(): Unable to decompress C:ETLPOSDataIngramWeeklyINVEN.zip; The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.

Error: 0x4 at Unzip downloaded file: The Script returned a failure result.

Task failed: Unzip downloaded file

The zip file unzips perfectly using winzip utility, so that file is definitely not a problem here.

The code I am using in a script task is as follows:

' Microsoft SQL Server Integration Services Script Task

' Write scripts using Microsoft Visual Basic

' The ScriptMain class is the entry point of the Script Task.

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Imports System.IO

Imports System.Text

Imports System.IO.Compression

Public Class ScriptMain

' The execution engine calls this method when the task executes.

' To access the object model, use the Dts object. Connections, variables, events,

' and logging features are available as static members of the Dts class.

' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.

'

' To open Code and Text Editor Help, press F1.

' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

'

' Add your code here

'

Dts.TaskResult = Dts.Results.Success

Dim success As Boolean = True

Dim workFilePath As String

workFilePath = Dts.Variables("zipFilePath").Value.ToString()

If File.Exists(workFilePath) Then

If Not workFilePath.EndsWith(".zip") Then

Dts.Events.FireInformation(0, "", workFilePath + " is not compressed; skipping decompression", Nothing, -1, True)

Return

End If

Dim uncompressedFileName As String

Dim bytes(Int16.MaxValue) As Byte

Dim n As Integer = 1

Try

uncompressedFileName = Dts.Variables("unCompressedFileName").Value.ToString()

Dts.Events.FireInformation(0, "", "decompressing " + workFilePath + " to " + uncompressedFileName, Nothing, -1, True)

Using writer As New FileStream(uncompressedFileName, FileMode.Create)

Using compressedStream As Stream = File.Open(workFilePath, FileMode.Open, FileAccess.Read, FileShare.None)

Using unzipper As New GZipStream(compressedStream, CompressionMode.Decompress)

Do Until n = 0

n = unzipper.Read(bytes, 0, bytes.Length)

writer.Write(bytes, 0, n)

Loop

unzipper.Close()

End Using

compressedStream.Close()

End Using

writer.Close()

End Using

Catch ex As Exception

Dts.Events.FireError(0, ex.TargetSite().ToString(), "Unable to decompress " + workFilePath + "; " + ex.Message, Nothing, -1)

success = False

Finally

If success = False And File.Exists(uncompressedFileName) Then

Dts.TaskResult = Dts.Results.Failure

File.Delete(uncompressedFileName)

End If

End Try

Else

Dts.Events.FireError(0, "", workFilePath + " does not exist", Nothing, -1)

Dts.TaskResult = Dts.Results.Failure

Return

End If

End Sub

End Class

Instead of the GZipStream do I have to use some other stream class for a zip file.  Please let me know.

Thanks,

Monisha

View 9 Replies View Related

Keep Failing On Trying To Install SQL 2005 Express (I've Read Many Posts But Still No Solution)

Jan 2, 2008

I use Widows Vista Business, have uninstalled all previous versions of SQL before installing SQL 2005 Express.

At first, I faced "Receiving WMI configuration error. SQL Server System Configuration cannot be executed due to to WMI configuration on this computer Error:2147749896 (0x80041008)."

Then, I tried this cmd someone posted as:





FIXWMI.CMD
------------------------

@echo on
cd /d c: emp
if not exist %windir%system32wbem goto TryInstall
cd /d %windir%system32wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 -s %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End

:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer

kipSrv
goto End

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End

I tried to install SQL2005 Express again, but then it gives:

Error 1603 installing Microsoft SQL Native Client.

View 1 Replies View Related

Forum Help

Jun 16, 2004

are you able to see the posts in

http://www.dbforums.com/t1001477.html

??

I am seeing a blank page.

View 4 Replies View Related

Forum Recommendation

Sep 8, 2004

Can anyone recommend me other "REALLY GOOD" msql server forums?

Thanks

View 1 Replies View Related

I Hope Its The Right Forum...

Sep 12, 2005

how to use MSSQL in asp.net?

View 2 Replies View Related

Best General SQL Forum

Apr 28, 2008

I'm not impressed with the speed/quality of responses from this forum...

Can anybody recommend a more active forum?

View 20 Replies View Related

Best Way To Design A Forum?

Nov 7, 2007

Hi everyone,

Our company plans to redesign the forum. we currently stores all posts in text files. someone suggest that we can use xml. I am not familiar with using xml. Is XML better for the forum design and data retriving?

Thanks in advance

View 4 Replies View Related

Question About Forum

Jun 6, 2007

Can anyone tell me , For instance : if someone has posted new post and If I want to answer to that post, how can I answer that. Or How do I know that there is some new post which people can response to it, please give me your feed back on this



thank you

View 5 Replies View Related

Msdn Forum

Mar 14, 2008



Where is the list for forums,
When i started to write for Sqlserver, i never searched or looked for forum. Same did when i was working with the c#.
Now I have to find the correct forum. So where is the list of those forums, thanks.

View 3 Replies View Related

This Forum Is BROKEN!!!!

Mar 8, 2007

Anyone having problems with this forum today?

 

I have had countless email alerts thru today alerting me to people replying to threads I have commented on. And I can see the person's comments.

 

1) WhenI click on the link it takes me to a page saying the post doesn't exist

2) When I try and browse to the thread manually I can't see the reply.

3) On one occasion I replied to one of these threads asking if someone had posted something and then deleted it. After I submitted the post I could see all the other posts in the thread which were supposedly missing before. The next time I browse to the thread (in a new browser window) I can't see any of the posts.

 

BROKEN!!!! I for one won't be coming back here until they fix it. Its pathetic.

I have posted something on the bug report forum by the way.

-Jamie

P.S. Its not just on this forum either.

View 8 Replies View Related

Setup Forum?

Apr 27, 2006

Where would I find this. It's not listed under SQL forums. Is this a general setup forum or specific to SQL?



Thanks......

View 1 Replies View Related

Our Forum Has Msgs &&> 8K

Jan 28, 2008

Hi,

Our website provide users with a forum where they can enter messages. So, typically, a user would enter a message, click submit, and their message would be displayed on the forum.

The db that stores these msgs uses a varchar field. Now, we're adding a facility to convert any urls that are entered to links by adding 'a href' tags, so that when users see messages with urls, those urls appear as links, and they can click on them. The problem is that if a user enters a message of 8K chars, then we add 'a href' tags to any urls they have, that makes the message length > 8K, preventing us from storing it in our db. (Please note that we do need to add HTML tags for other reasons as well, not just to convert urls to links.)

We thought about adding 'a href' tags during pre-render, thus avoiding storing html in the db, but found that doing such string manipulations, while a user is waiting to see their post displayed on the forum, was expensive. Timing tests revealed that the time to render such pages more than doubled.

I have solved such problems previously by adding an extra field in the db to store any overflow data, that is, data that appears after the first 8K chars.

However, I learnt of sql server 2005's varchar(max) datatype, and 'am wondering if the best way to solve this problem would be to replace the varchar field with varchar(max).

Thanks in advance for any advice.
Shefali

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved