Archive for August, 2009
z index in IE 6
Aug 11th
problem:
overlap div in IE6, z index is not working correctly in IE6
solution:
- put the relative position in "wrapper" div
- for the overlaped div, put on absolute positions
css code example:
#wrapper{ position: relative; }
#box1 { position: absolute; top: 150px; left:60px;width: 200px; height: 200px; background-color: yellow; z-index: 20; }
#box2 {position: absolute; top: 100px; left: 0px;width: 200px; height: 200px; background-color: lime; z-index: 10; }
html code example:
<div id="wrapper">
<div id="box1">
<p>
This box should be on top</p>
</div>
<div id="box2">
<p>
box 2</p>
</div>
</div>
calculating age in sql
Aug 3rd
problem:
display age with sql command
solution:
sql command:
SELECT DATEDIFF(mm, dateOfBirth, GETDATE()) / 12 AS age
FROM someTable
it wil display age ^^V
birthday reminder list asp.net
Aug 3rd
problem:
displaying list of bday boy/girl in next (30/ according to your own choice ) days from the current date.
solution:
im using the sql to select the date of birth, for displaying, you can use whatever you want, like gridview, datalist etc.
hereby the sql command:
SELECT DateOfBirth
FROM someTablename
WHERE (DateOfBirth < GETDATE()) AND (DATEDIFF(d, GETDATE(), DATEADD(yy, DATEDIFF(yy, DateOfBirth, GETDATE()), DateOfBirth)) BETWEEN
0 AND 30)
it will return the list of date of birth from the current date.
for reference of the sql command:
http://msdn.microsoft.com/en-us/library/aa258269%28SQL.80%29.aspx