Visual Basic - CRYSTAL SQLQUERY con ACCESS

Life is soft - evento anual de software empresarial
 
Vista:

CRYSTAL SQLQUERY con ACCESS

Publicado por celso (96 intervenciones) el 20/11/2001 18:20:23
ESTOY INTENTANDO USAR LA PROPIEDAD SQLQUERY DE CRYSTAL REPORT PERO AUNQUE NO ME DA ERRORES NO FUNCIONA.
ALGUIEN ME PUEDE FACILITAR UN EJEMPLO DE COMO USARLA, ES URGENTE.
MUCHAS GRACIAS
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:CRYSTAL SQLQUERY con ACCESS

Publicado por Lino (20 intervenciones) el 20/11/2001 22:11:31
Aquí va el ejemplo (Funciona sin problemas), primero debes crear el Query sin eliminarlo para poder poder generar el reporte (solo rvidrios.rpt está con query). Saludos ...

Dim ReporteSeleccionado As String
Dim Fecha1 As String
Dim Fecha2 As String
Dim miquery As QueryDef

On Error GoTo ErrorImpresion
If Not IsDate(TxtFechaDe.Text) Then
MsgBox "Fecha de inicio no válida"
SendKeys "{home}+{end}"
TxtFechaDe.SetFocus
Exit Sub
End If
If Not IsDate(TxtFechaA.Text) Then
MsgBox "Fecha de término no válida"
SendKeys "{home}+{end}"
TxtFechaA.SetFocus
Exit Sub
End If

FrmVentas.CR1.DataFiles(0) = Trim(DirectorioBD) + Trim(NombreBD)
If Index = 0 Then
ReporteSeleccionado = "rcredito.rpt"
Fecha1 = Format(TxtFechaDe.Text, "YYYY") + "," + Format(TxtFechaDe.Text, "mm") + "," + Format(TxtFechaDe.Text, "dd")
Fecha2 = Format(TxtFechaA.Text, "YYYY") + "," + Format(TxtFechaA.Text, "mm") + "," + Format(TxtFechaA.Text, "dd")
FrmVentas.CR1.ReportFileName = Trim(DirectorioReportes) & ReporteSeleccionado
FrmVentas.CR1.SelectionFormula = "{CuentaClientes.CC_fecha}>=Date(" + Fecha1 + ") and {CuentaClientes.CC_Fecha}<=Date(" + Fecha2 + ")"
Else
ReporteSeleccionado = "rvidrios.rpt"
FrmVentas.CR1.ReportFileName = Trim(DirectorioReportes) & ReporteSeleccionado
Consulta = "select left(V_Codigo,5) as SFamilia,* f
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar