Solved

FrontPage Date Format - The "new column" trick

Posted on 2004-09-08
5
188 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

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…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
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…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

749 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