Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Control in Interdev

Status
Not open for further replies.

xplora47

IS-IT--Management
Nov 26, 2001
3
0
0
GB
Hi,I have a web page that passes a start date and and end date into a crystal report. The date in the database is in the format YYYYMMdd and when I pass in from the activeX control I get eg 1st of november 2001 would be 1/11/2001.

How do I make the data read 01/11/2001 or 01/01/2001.

Any single digit month or day cuts out the "0" and screws up the data being passed in.

Thanks for any tips.
p.s.
I am not an experienced programmer, so the more basic the solution the better.
 
You could try two ways:

1) Pass the date to the crystal report already formatted to yyyymmdd.

MyRpt.SelectionFormula = _
"[dbDate = ' " & format(activex.value, "yyyymmdd") & "']"

2) Break up the date in your VB Code...........

myDate = Split(Format(activeX.value, "mm/dd/yyyy"), "/")
strRptToMo = varDate(0)
strRptToDay = varDate(1)
strRptToYr = varDate(2)

strSelectionFormula = "{dbDate} = " & _
" Date(" & strRptFromYr & "," & strRptFromMo & "," & strRptFromDay & ")"

myRpt.SelectionFormula = strSelectionFormula
myRpt.Action = 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top