Author |
Topic |
jberthiaume
Starting Member
5 Posts |
Posted - 2012-08-01 : 15:30:32
|
Hi, I am trying to figure why the "Age" category of my database doesn't upload correctly for all the players in the database. Here is what it presently looks like: http://www.themshl.com/player_list.phpEach player in the .csv file has its date of birth and the age should be calculated automatically for every player on the website, after the upload, but it doesn't work.There are a total of 1468 players and exactly 889 players don't have their age.Any help would be appreciated.Thank you |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-08-01 : 15:47:41
|
You have to find the difference between the birthdates that work and that dates which don't work.We can't see anything from here... No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-08-02 : 03:53:11
|
Are the dates in the .csv-file of correct format and valid dates? Post a sample from the csv with some of the players that don't have their age calculated correctly.- LumbagoMy blog-> http://thefirstsql.com |
|
|
jberthiaume
Starting Member
5 Posts |
Posted - 2012-08-02 : 04:43:33
|
Here is the title bar: Number Name Team Country AgeDatePlayer that works:81 Aaron Palushaj 0 USA 9/7/1989Player the don't work:78 Aaron Gagnon 0 CAN 4/24/1986Exactly the same thing if you ask me... |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-08-02 : 05:52:57
|
It's probably a date format issue and the order of day and month. I would guess that your database reads the date in DD/MM/YYYY format while the date is actually MM/DD/YYYY.- LumbagoMy blog-> http://thefirstsql.com |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-08-02 : 05:54:58
|
What is the data type of this column in your database? You should use datetime and the display the age as DATEDIFF(year, date_column, getdate())- LumbagoMy blog-> http://thefirstsql.com |
|
|
jberthiaume
Starting Member
5 Posts |
Posted - 2012-08-02 : 06:47:38
|
In the database, its a type: double.The date format issue seems completely right!Where am I supposed to modify the date entry format to (year, date_column, getdate()) ? |
|
|
jberthiaume
Starting Member
5 Posts |
Posted - 2012-08-02 : 06:51:28
|
No sorry, the agedate column is a varchar(10)The age column is a double. |
|
|
jberthiaume
Starting Member
5 Posts |
Posted - 2012-08-02 : 07:17:18
|
Got it !!!!Thank you very much !!!! |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-08-02 : 07:42:03
|
Excellent :)- LumbagoMy blog-> http://thefirstsql.com |
|
|
|