CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Mask Label

Print topic Send  topic

Author Message
Michelle
Posted: 11/22/2004, 7:30 AM

How can I mask a text field like this:
1056 to 10:56
925 to 9:25

and so on.... the value is displayed in a label field

Using SQL, ASP

Thanks
mrachow


Posts: 509
Posted: 11/22/2004, 1:12 PM

Hi Michelle,

do you really have the times as text fields?

What about 111?
Is it 1:11 for sure or if 11:1 would you have 1101?

Thanks,
Michael
_________________
Best regards,
Michael
View profile  Send private message
kevind

Posts: 251
Posted: 11/22/2004, 1:32 PM

Is the data in the database stored as text or date / time - you can format the text fields for date / time through CCS.

Kevin
_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message
Michelle
Posted: 11/23/2004, 8:34 AM

Its saved as text, and I try to format it as Date/Time H:nn but it displays 12:00 always.
Searching the web i found the Mid function, but dont know how to implement it in CCS.
There're PlugIns for CCS, Where I can Download them?
Michelle
Posted: 11/23/2004, 8:35 AM

Its saved as text, and I try to format it as Date/Time H:nn but it displays 12:00 always.
Searching the web i found the Mid function, but dont know how to implement it in CCS.
There're PlugIns for CCS, Where I can Download them?
dataobjx


Posts: 181
Posted: 11/23/2004, 5:30 PM

Quote Michelle:
How can I mask a text field like this:
1056 to 10:56
925 to 9:25

and so on.... the value is displayed in a label field

Using SQL, ASP

Thanks

Like This;

Function FormatTimeAsText(vTextTime)
Dim iPos
Dim sResult
Dim sFirstPart
Dim sLastPart
Dim sTextTime

sTextTime = CStr(Trim(vTextTime))

'Locate the position of the : colin
iPos = Instr(1, sTextTime, ":")

'Locate the text before the : colin
sFirstPart = Mid(sTextTime, 1, iPos-1)

'Locate the text after the : colin
sLastPart = Mid(sTextTime, iPos+1, len(sTextTime))

'now concatenate the values into the string
sResult = sFirstPart & sLastPart

FormatTimeAsText = sResult
End Function

Function FormatTextAsTime(vTextTime)
Dim iPos
Dim sResult
Dim sFirstPart
Dim sLastPart

If Len(vTextTime) = 3 Then
'Locate the text before the : colin
sFirstPart = Mid(vTextTime, 1, 1)
'Locate the text after the : colin
sLastPart = Mid(vTextTime, 2, len(vTextTime))
ElseIf Len(vTextTime) = 4 Then
'Locate the text before the : colin
sFirstPart = Mid(vTextTime, 1, 2)
'Locate the text after the : colin
sLastPart = Mid(vTextTime, 3, len(vTextTime))
End If

'now concatenate the values into the string
sResult = sFirstPart & ":" & sLastPart

FormatTextAsTime = sResult
End Function

Function lblTextTime_BeforeShow() 'lblTextTime_BeforeShow @2-2F746B39

'Custom Code @3-73254650
' -------------------------
' Write your own code here.
Dim testTime
'1056 to 10:56
'925 to 9:25

testTime = "1056" 'to 10:56
testTime = "925" 'to 9:25
lblTextTime.value = FormatTextAsTime(testTime)

testTime = "10:56" 'to 1056
'testTime = "9:25" 'to 925
lblTextTime.value = FormatTimeAsText(testTime)

' -------------------------
'End Custom Code

End Function 'Close lblTextTime_BeforeShow @2-54C34B28

_________________
www.DataObjx.net
www.mydigitalapps.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.