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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Birthdate and other issue...

Author  Topic 

floker
Starting Member

6 Posts

Posted - 2009-09-28 : 08:54:59
Hello all,

I'm new on this forum. I have two issues that I would like to share with you and hopefully someone can help me. This are two issues that I have to solve for my work.

1. We have some webservices to add members into our database. The problem is that some characters are not added into the database. They are just ignored. The characters are â,ä,ü,é,è,ç and some other german characters. When I check the log files, those characters are displayed as followed : %E2, %EB, %FC; %F6; %D6,.... Does someone know what I have to change in order to read this characters into the DB?

2. I need to create a querry which will return all the members with their birthday in the coming weeks. I have to run it every week, so this week I need to know the members with their birthday next week and so on... There are two tricky things about it. First of all I should be able to say how many members it will be for a chosen week. And secondly the year should be ignored in the querry since we have members between 10 and 100 years.


Hope this is clear enough.

Thanks all for your help

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-29 : 00:54:57
[code]
1.try saving unicode values of characters
2. DECLARE @WeekStart datetime,@WeekEnd datetime
SELECT @WeekStart=DATEADD(wk,DATEDIFF(wk,0,GETDATE())+1,0),
@WeekEnd=DATEADD(wk,DATEDIFF(wk,0,GETDATE())+2,0)-1

SELECT
FROM YourTable
WHERE DATEADD(yy,-1* (YEAR(dob)-1900),dob) >=DATEADD(yy,-1 * (YEAR(@WeekStart)-1900),@WeekStart)
AND DATEADD(yy,-1* (YEAR(dob)-1900),dob) < DATEADD(yy,-1 * (YEAR(@WeekEnd)-1900),@WeekEnd)+1
[/code]
Go to Top of Page
   

- Advertisement -