Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
Javascript where clause for string that begins with text

Here is a sample of the Javascript, that I want to add an additional WHERE statement to the CONDITIONS variable.

In addition to Where Cost > 0, only include records where ProductName begins with "XYZ".
Maybe: AND ProductName StartsWith('XYZ') ??

  REPORTS: [{NAME: 'MYREPORTNAME',
     CONDITIONS: 'WHERE Cost > 0',
     FIELDS: {'ProductSKU' : 'STRING',
              'ProductName' : 'STRING',
              'Cost' : 'FLOAT'  
             }

This is later called in this function:

function retrieveMyReport(reportConfig, ClientId) {
  var fieldNames = Object.keys(reportConfig.FIELDS);
  var report = MyApp.report(
    'SELECT ' + fieldNames.join(',') +
    ' FROM ' + reportConfig.NAME + ' ' + reportConfig.CONDITIONS +
    ' DURING ' + CONFIG.DEFAULT_DATE_RANGE);
...

How do I expand this WHERE clause to include both conditions?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This looks like an SQL query, so you should probably use the LIKE operator:

CONDITIONS: 'WHERE Cost > 0 AND ProductName LIKE \'XYZ%\''
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda