Groups | Blog | Home
all groups > sql server (alternate) > july 2006 >

sql server (alternate) : Insert Function Help


riley.derrick NO[at]SPAM gmail.com
7/7/2006 8:10:22 AM
Hello All

I have been looking over the various forums and threads trying to learn
as much as I can. Here is my issue. I am trying to do the following:

Write a function that involves the following: Calculates the
following. 2 user inputted dates. (Ex. Jan 1 2000 -- Jan 1 2004).
Figures out the number of months between the 2 dates. That number is
then multiplied by a user input price that outputs some number. Problem
is I am new to SQL and having some trouble getting started. Any hepl
would be appreciated.
rhaazy
7/7/2006 10:45:26 AM
Take a look at this site:

http://aspalliance.com/chapters/chapters/0672323834/0672323834_ch03.aspx

search for the words "datediff"

This is the function you will need to use, it is of the form

Datediff( datepart, startdate, enddate ). This function returns the
difference of two dates in units determined by the datepart argument.


[quoted text, click to view]
Tiger
7/7/2006 12:41:46 PM
Thanks alot...
That helps out so much. I really appreciate it. Thank you
[quoted text, click to view]
AddThis Social Bookmark Button