Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with duplicate values

Author  Topic 

ntho9
Starting Member

1 Post

Posted - 2012-01-06 : 11:18:38
Hi there,

I'm new to both the forum and the world of SQL programming, so please bear with me.

I am currently using Sybase to pull information from a few tables and collate them into one table which I can then export. I can get the data to display but the data in the end column (LogoutDt) is full of duplicates of that days date.

I would like any duplicate dates in that column to display Null. eg:

LogoutDt

01/01/2012
(null)
(null)
(null)
02/01/2012
(null)

I have looked online for this, however can't find anything that has been able to help me. I am unsure if this can even be done.

Also, I do not have full access to this database (read only) if that makes any difference; here is the code I have so far:

SELECT DISTINCT dbo.AgentIdleDetail.User_Id, IdleStartDt, IdleEndDt, dbo.AgentLoginLogout.LoginDt, LogoutDt
FROM dbo.AgentIdleDetail, dbo.AgentLoginLogout
WHERE dbo.AgentIdleDetail.User_Id = dbo.AgentLoginLogout.User_Id

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-06 : 13:40:03
If you're using Sybase you're in wrong forum. This is ms sql server forum so solutions given here are mostly sql server specific. so please try your luck at sybase specific forum like one at www.dbforums.com



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -