BrianJBaldwin

Date from UserForm as input to SQL Query

Discussion created by BrianJBaldwin on Jun 6, 2013
Latest reply on Jun 6, 2013 by BrianJBaldwin
I am just wondering how to place the values from my userform into the IQueryDescription SQL code.  I know this is a pretty entry question, but am just held up at this last step.  Currently, the FM_DATE has hard values in it, but I want to replace these with the TimeStart and TimeEnd userform input.

 
Dim TimeStart As Date
Dim TimeEnd As Date

TimeStart = Me.Time1.Value
TimeEnd = Me.Time2.Value

        Dim queryDescription As IQueryDescription = sqlWorkspace.GetQueryDescription("SELECT DCS_Fact.FM_DATE FROM DCS_Fact INNER JOIN TIBURON.INMAST ON DCS_Fact.DR = TIBURON.INMAST.IM_DR WHERE (DCS_Fact.FM_DATE >= '2012-01-01') AND (DCS_Fact.FM_DATE <= '2012-12-31')")
        Dim queryClass As ITable = sqlWorkspace.OpenQueryClass("Parcels", queryDescription)

Outcomes