Sunday, October 12, 2008

Function Date and Time in Foxpro

Programming

Sometime we still find or using database like foxpro, Just Like today I want to get the data using dababase foxpro using SQL command:

Select * from data1 where tanggal = ‘11/28/2007′ but its not return any record

to get the data result I have to add function ctod before date :

select * from data1 where tanggal = ctod (’11/28/2007′)

When I try that command its working..:)

I write Below Command as your reference

Below is Function Date and Time in Foxpro :

1. Overview Date and Time Functions
For more detail please refer to VFP help files.
Date and Time Functions
CDOW( ) Function
Returns the day-of-the-week from a given Date or DateTime expression.
CMONTH( ) Function
Returns the name of the month from a given date or DateTime expression.
CTOD( ) Function
Converts a character expression to a date expression.
CTOT( ) Function
Returns a DateTime value from a character expression.
DATE( ) Function
Returns the current system date, which is controlled by the operating system.
DATETIME( ) Function
Returns the current date and time as a DateTime value.
DAY( ) Function
Returns the numeric day-of-the-month for a given Date or DateTime expression.
DMY( ) Function
Returns a character expression in day-month-year format (for example, 31 May 1996) from a Date or DateTime expression. The month name isn’t abbreviated.
DOW( ) Function
Returns a numeric day-of-the-week value from a Date or DateTime expression.
DTOC( ) Function
Returns a Character-type date from a Date or DateTime expression.
DTOS( ) Function
Returns a character-string date in a yyyymmdd format from a specified Date or DateTime expression.
DTOT( ) Function
Returns a DateTime value from a Date expression.
FDATE( ) Function
Returns the last modification date for a file.
FTIME( ) Function
Returns the last modification time for a file.
GOMONTH( ) Function
Returns the date that is a specified number of months before or after a given Date or DateTime expression.
HOUR( ) Function
Returns the hour portion from a DateTime expression.
MDY( ) Function
Returns the specified date or datetime expression in month-day-year format with the name of the month spelled out.
MINUTE( ) Function
Returns the minute portion from a DateTime expression.
MONTH( ) Function
Returns the number of the month for a given Date or DateTime expression.
SEC( ) Function
Returns the seconds portion from a DateTime expression.
SECONDS( ) Function
Returns the number of seconds that have elapsed since midnight.
SET HOURS Command
Sets the system clock to a 12- or 24-hour time format.
SET MARK TO Command
Specifies a delimiter for the display of date expressions.
SET SECONDS Command
Specifies whether seconds are displayed in the time portion of a DateTime value.
SYS(1) Function - Julian System Date
Returns the current system date as a Julian day number character string.
SYS(2) Function - Seconds Since Midnight
Returns the number of seconds elapsed since midnight.
SYS(10) Function - String From Day Number
Converts a Julian day number to a character string.
SYS(11) Function - Julian Day Number
Converts a date expression or character string in date format to a Julian day number.
TIME( ) Function
Returns the current system time in 24-hour, eight-character string (hh:mm:ss) format.
TTOC( ) Function
Converts a DateTime expression to a Character value of a specified format.
TTOD( ) Function
Returns a Date value from a DateTime expression.
WEEK( ) Function
Returns a number representing the week-of-the-year from a Date or DateTime expression.
YEAR( ) Function
Returns the year from the specified date or datetime expression.

Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
Function Date and Time in Foxpro

No comments:

Post a Comment