navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Woah, Mama!

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Woah, Mama!
Page: [1]
 
DarlingBri

 

Posts: 3123
From: Left of Centre, Cork, Ireland
Status: offline

 
Woah, Mama! - 2/18/2002 0:04:17   
OK, I'm using the DRW to pull a single record from a database. The field is a test field or a memo field - whichever is bigger, I can never remember. Anyway, there's rather a lot of text in there, and I only want it to display the first, say, 300 characters or whatever.

Just, you know... less!

Oh, and also, I need to display the associated date, which is being displayed. However, it's stored in the database as 20020213072621 - which is: year 2002 month 02 day 13 time 07:26:21. But I want it to display like, you know, any normal date and time!

Can someone smart tell me how do I do that? Thanks

--Bri
-----
#!usr/bin/girl
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: Woah, Mama! - 2/18/2002 8:53:19   
Using something like:

<%=Left(FP_FieldVal(fp_rs,"memoField"),300)%>

will get you the first 300 char of your memo field.

<%=FormatDateTime(FP_FieldVal(fp_rs,"dateField"), 2)%>

will give you the date from 'dateField' in MM/DD/YYYY format. See this link for more details:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctformatdatetime.asp

Hope it helps...

 

(in reply to DarlingBri)
DarlingBri

 

Posts: 3123
From: Left of Centre, Cork, Ireland
Status: offline

 
RE: Woah, Mama! - 2/18/2002 9:08:49   
Thank you for your reply :)

It seems to think that <%=FormatDateTime(FP_FieldVal(fp_rs,"T_DATE"), 2)%> is a "Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'FormatDateTime'" though


--Bri
-----
#!usr/bin/girl

(in reply to DarlingBri)
DarlingBri

 

Posts: 3123
From: Left of Centre, Cork, Ireland
Status: offline

 
RE: Woah, Mama! - 2/18/2002 9:11:00   
Oooh, but the 300 characters thing works perfectly! Thank you

--Bri
-----
#!usr/bin/girl

(in reply to DarlingBri)
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: Woah, Mama! - 2/18/2002 9:46:09   
OOPS - I may have missed something. Is it stored in the DB as a text string and not a date/time field? If so, you may need to grab the date(s) using string manipulation. Something like:

<%=Mid(FP_FieldVal(fp_rs,"dateField"), 5, 2)%>/<%=Mid(FP_FieldVal(fp_rs,"dateField"), 7, 2)%>/<%=Left(FP_FieldVal(fp_rs,"dateField"),4)%>

That should give you a string that looks like MM/DD/YYYY however, that is not a date/time value. AT least that's how I'd do it if it is a text string and not a date/time field....

 

(in reply to DarlingBri)
DarlingBri

 

Posts: 3123
From: Left of Centre, Cork, Ireland
Status: offline

 
RE: Woah, Mama! - 2/18/2002 10:03:16   
I have no idea how it's stored except as a string of silly numbers, but what you just said works perfect-o!

xoxoxoxoxo

--Bri
-----
#!usr/bin/girl

(in reply to DarlingBri)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Woah, Mama!
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts