I want to know if there is a way to add minutes to a date. I tried the DATEADD() function but I got nowhere. I'm open to other ways to get to do it.
My code
select
visits.delivery_max,
visits.delivery_min,
DATE_PART('minute',delivery_max-delivery_min)/2 as diff
DATEADD('minute',DATE_PART('minute',delivery_max-delivery_min)/2 ,visits.delivery_min)
from visits
where
visits.delivery_max is not null
and visits.delivery_min is not null
Without DATEADD()
With DATEADD()
Hi @Vallistruqui
Post "Diagnostic Info" from Admin > Troubleshooting, and which database type you are querying.
{
"browser-info": {
"language": "es-ES",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.7+10",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.7",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.7+10",
"os.name": "Linux",
"os.version": "5.4.95-42.163.amzn2.x86_64",
"user.language": "en",
"user.timezone": "America/Argentina/Buenos_Aires"
},
"metabase-info": {
"databases": [
"postgres"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "10.15"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.8"
}
},
"run-mode": "prod",
"version": {
"date": "2021-01-05",
"tag": "v0.37.5",
"branch": "release-x.37.x",
"hash": "be537ee"
},
"settings": {
"report-timezone": "America/Buenos_Aires"
}
}
}