Difference between revisions of "Ns buildsqldate"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 524)
 
 
Line 31: Line 31:
 
: [[ns_buildsqltime]], [[ns_buildsqltimestamp]], [[ns_parsesqldate]], [[ns_parsesqltime]], [[ns_parsesqltimestamp]]
 
: [[ns_buildsqltime]], [[ns_buildsqltimestamp]], [[ns_parsesqldate]], [[ns_parsesqltime]], [[ns_parsesqltimestamp]]
  
----
+
[[Category:Documentation]] [[Category:Core Tcl API]]
 
 
[[Category Documentation]] - [[Category Core Tcl API]]
 

Latest revision as of 20:04, 7 February 2009

Man page: http://aolserver.com/docs/tcl/ns_buildsqldate.html


NAME

ns_buildsqldate - Build a SQL date value from specified month, day, and year

SYNOPSIS

ns_buildsqldate month day year

DESCRIPTION

This command builds a SQL date string out of the specified month, day, and year. The month can be the month number (1 - 12) or the full, capitalized month name (January, February, ..., December). The day must be a number from 1 - 31, and the year must be a 4-digit year (e.g., 1957). An error is returned if any of the argument values are invalid. The resulting string can be used in an SQL statement.

EXAMPLES

   % ns_buildsqldate "01" "15" "1929"
   1929-01-15
   % ns_buildsqldate "13" "31" "2000"
   Invalid date: 13 31 2000
       while executing ...
   % set thedate ns_buildsqldate "January" "15" "1929"
   % ns_db dml $db "INSERT INTO mytable (datefield) VALUES (ns_dbquotevalue $thedate)"

SEE ALSO

ns_buildsqltime, ns_buildsqltimestamp, ns_parsesqldate, ns_parsesqltime, ns_parsesqltimestamp