Browse Source

chore: date/datetime comparison correction - MySQL

pull/6507/head
Pranav C 1 year ago
parent
commit
e40830954e
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 6
      packages/nocodb/src/db/conditionV2.ts

2
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -10,11 +10,11 @@ import {
computed,
iconMap,
inject,
onMounted,
ref,
useNuxtApp,
useViewFilters,
watch,
onMounted
} from '#imports'
import type { Filter } from '#imports'

6
packages/nocodb/src/db/conditionV2.ts

@ -460,7 +460,11 @@ const parseConditionV2 = async (
].includes(column.uidt)
) {
qb = qb.where(field, val);
} else if (column.ct === 'timestamp' || column.ct === 'date' || column.ct === 'datetime') {
} else if (
column.ct === 'timestamp' ||
column.ct === 'date' ||
column.ct === 'datetime'
) {
qb = qb.where(knex.raw('DATE(??) = DATE(?)', [field, val]));
} else {
// mysql is case-insensitive for strings, turn to case-sensitive

Loading…
Cancel
Save