Solved

FrontPage Date Format - The "new column" trick

Posted on 2004-09-08
5
183 Views
Last Modified: 2013-12-24
Greetings!  I hope someone can help me with a date format problem I'm having.

The scenario:

1. I have an Access database with a date field.
2. The date is formatted as MM/DD/YYYY.
3. Using the FrontPage Database results wizard, I add my database results to an active server page.
4. After uploading to my server, the displayed format changes to DD/MM/YYYY.

What I need to accomplish:

I need to display the date in MM/DD/YYYY format.

Now, there's definitely a method to solve my problem.  It involves adding a custom query to the database results wizard.  This query creates a new date column (such as "date2"), which is displayed properly on the page.

My question:

How do I create this query?

I know someone here will know, and I thank anyone and everyone who tries to help.

Thanks so far,

Courtney
0
Comment
Question by:LilCourt
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:rcmb
Comment Utility
You can easily manipulate the format with VBScript by changing your results in your ASP code to:


date will equal the name of the field in the database
<%
varDay = Day(fp_rs("date"))
varMonth = Month(fp_rs("date"))
varYear = Year(fp_rs("date"))
%>

then display in your table column as (note: you will need to delete the FP generated field in the column)

<%=varMonth%>/<%=varDay%>/<%=varYear%>

RCMB
0
 

Author Comment

by:LilCourt
Comment Utility
Thanks for responding, rcmb!  That'll get the desired result, but it's not exactly what I'm looking for.  The method I'm talking about doesn't really require any changing of the ASP code, which is what I'm going for.  I wish I could explain this better, but I really don't know how.

In any case, thank you very much for this suggestion.
0
 
LVL 12

Accepted Solution

by:
rcmb earned 135 total points
Comment Utility
Okay here is a sample SQL query you can enter directly into the FP DBRW (select custom query in step 2) that will format the date as desired:

SELECT StartTime, EndTime, (Month(EventDate) & '/' & Day(EventDate) & '/' & Year(EventDate)) AS MyDate, Location, Approved, DateAdd, DateMod FROM Events

Pay attention to the date formatting (Month(EventDate) & '/' & Day(EventDate) & '/' & Year(EventDate)) AS MyDate so you can manipulate the order as desired.

Once you are complete with the DBRW it will display MyDate in the column or location you desire.

RCMB
0
 

Author Comment

by:LilCourt
Comment Utility
I love you!  You're the best!

Courtney
0
 
LVL 12

Expert Comment

by:rcmb
Comment Utility
Wow - can I help you more!!!

Thanks for the points and glad we got this working.

Curtis
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now