31 Maret 2010

Menampilkan format tanggal pada Ms. Access

. 31 Maret 2010

access

SELECT Format(tgl_surat,'mm/dd/yyyy') As tgl_surat1 FROM adm_surat

 

dari contoh di atas akan menghasil data tgl_surat1 ==> 03/24/2010

 

berikut ini tabel daftar kode format tanggal pada ms. Access 2007 :

 

Date separator

Controls where Access places the separator for days, months, and years. Use the separator defined in your Windows regional settings. For information about those settings, see How Windows regional settings affect formatting, earlier in this topic.

c

Displays the general date format.

d or dd

Displays the day of the month as one or two digits. For one digit, use a single placeholder, for two digits, use two placeholders.

ddd

Abbreviates the day of the week to three-letters.

For example, Monday appears as Mon.

dddd

Spells out all days of the week.

ddddd

Displays the Short Date format.

dddddd

Displays the Long Date format.

w

Displays the number of the day of the week.

For example, Monday appears as 2.

m or mm

Displays the month as either a one-digit or two-digit number.

mmm

Abbreviates the name of the month to three-letters.

For example, October appears as Oct.

mmmm

Spells out all month names.

q

Displays the number of the current calendar quarter (1-4).

For example, for a date in May, Access displays 2 as the quarter value.

y

Displays the day of the year, 1-366.

yy

Displays the last two digits of the year.

Note    We recommend entering and displaying all four digits of a given year.

yyyy

Displays all digits in a year in the range 0100-9999.

Time separator

Controls where Access places the separator for hours, minutes, and seconds. Use the separator defined in your Windows regional settings. For information about those settings, see How Windows regional settings affect formatting, earlier in this topic.

h or hh

Displays the hour as one or two digits.

n or nn

Displays minutes as one or two digits.

s or ss

Displays seconds as one or two digits.

tttt

Displays the Long Time format.

AM/PM

Displays 12-hour clock values with a trailing AM or PM. Access relies on the system clock in your computer to set the value.

A/P or a/p

Displays 12-hour clock values with a trailing A, P, a, or p. Access relies on the system clock in your computer to set the value.

AMPM

Displays 12-hour clock values, but uses the morning and afternoon indicators specified in your Windows regional settings. For information about those settings, see How Windows regional settings affect formatting, earlier in this topic.

Blank space, + - $ ()

Use blank spaces, some math characters (+ -), and financial symbols ($ ¥ £) as needed anywhere in your format strings. If you want to use other common math symbols, such as slash (\ or /) and the asterisk (*), surround them in double quotation marks — note that you can place them anywhere.

"Literal text"

Surround any text that you want users to see in double quotation marks.

\

Forces Access to display the character that immediately follows. This is the same as surrounding a character in double quotation marks.

*

When used, the character following the asterisk (*) becomes a fill character — a character used to fill blank spaces. Access normally displays text as left aligned and fills any area to the right of the value with blank spaces. You can add fill characters anywhere in a format string, and when you do so, Access fills any blank spaces with the specified character.

[color]

Applies a color to all values in a section of your format. You must enclose the name in brackets and use one of these names: black, blue, cyan, green, magenta, red, yellow, and white.

Baca Juga

Cari yang lain:


1 comments:

feekyu mengatakan...

Waduyh bahasanya agak rumit ya. tapi buat belajar. ngk papa

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Posting Komentar

 
Kompiku.com Powered ByBlogger.com