Solved

FrontPage Date Format - The "new column" trick

Posted on 2004-09-08
5
184 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
ID: 12020551
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
ID: 12022440
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
ID: 12026068
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
ID: 12030376
I love you!  You're the best!

Courtney
0
 
LVL 12

Expert Comment

by:rcmb
ID: 12030405
Wow - can I help you more!!!

Thanks for the points and glad we got this working.

Curtis
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…

914 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

20 Experts available now in Live!

Get 1:1 Help Now