Microsoft
Software
Hardware
Network
Question : DateSold Field
I have a column called DateSold. It shows the date that the customer was sold. What I would like to do is to only show results that show the customers on their anniversary of datesold. In other words. This query I want it to show me Every customer that was sold on this date for every year.
So if I have four customers with different DateSolds
Bob 1/20/2010
Sue 1/15/2007
Carry 1/20/2004
Jim 1/20/1985
This query I would like to just see (Only three results) And so it only shows the month and day.
Bob 1/20
Jim 1/20
Carry 1/20
Code Snippet:
1: 2:
SELECT AccountNumber, CustomerName, DateSold FROM Telebill.dbo.Accounts
Open in New Window
Select All
Answer : DateSold Field
SELECT AccountNumber, CustomerName, RIGHT( CONVERT(varchar, DateSold, 112) ,4 ) DateSold
FROM Telebill.dbo.Accounts
WHERE RIGHT( CONVERT(varchar, getdate(),112) ,4 ) = RIGHT( CONVERT(varchar, DateSold, 112) ,4 )
Random Solutions
select only uppercase words from a table column
For Experts: Obfuscated Access Contest
In VFP how can you locate what windows users have use of a table or exclusive use of the table
How to shrink Wss_Content_log.ldf file in wss 3.0??
Defining anamed range dunamically
Binding ComboBox to ObserveableCollection: SelectedItem after deleting item from Collection
Move Combobox to Access TabControl on Form
VB .NET resetting a combo box
How can I install HP single sign on credentials manager onto a compaq TC4400 tablet running Windows 7?
Visual Studio update error "String Truncation"