Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format assistance please 1

Status
Not open for further replies.

jp3333

Technical User
Jun 22, 2007
11
US
I need to add the dayofweek and abbreviate the month in this formula - I need the date to display as: Thursday, Aug 30, 2007. Any help would be greatly appreciated!

The formula is:
Dim DateField as DateTime
Dim MM as String
Dim DD as String
Dim YYYY as String
Dim DATEORDER as String

DateField = {?StartDate}

MM = CStr(Month (DateField),0)
DD = CStr(Day (DateField),0)
YYYY = CStr(Year(DateField),0,"")

DATEORDER = {?DATEORDER}

if DATEORDER = "MDY" then
formula = MM + "/" + DD + "/" + YYYY
else
if DATEORDER = "MYD" then
formula = MM + "/" + YYYY + "/" + DD
else
if DATEORDER = "DMY" then
formula = DD + "/" + MM + "/" + YYYY
else
if DATEORDER = "DYM" then
formula = DD + "/" + YYYY + "/" + MM
else
if DATEORDER = "YDM" then
formula = YYYY + "/" + DD + "/" + MM
else
formula = YYYY + "/" + MM + "/" + DD
end if
end if
end if
end if
end if

 
Skip the formula.

Right click the date and select format field, within you can designate this output.

If you really want a formula, use:

totext({table.date},"dddd, MMM, dd, yyyy")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top