I have a snippet with a drop down menu populated from a Data Blaze table. The table contains over 800 rows but when accesed in the snippet not all the rows are listed. Is there a limit?
When using dbselect command without limit, only 200 rows are returned by default. To override it you should specify the limit explicitly. You can read more about this here.
Thank you
Are you able to help with the other problem I have. Date fields in DD/MM/YY format being brought over to a snippet from Data Blaze change to YY/MM/DD format. Is it possible to change this so the format is retained as DD/MM/YY
You can format dates that are returned from the dbselect command with the datetimeformat command:
{dbselect: SELECT datetimeformat(Date, "DD/MM/YYYY") as date FROM Table; space=SPACE_ID; menu=yes}
Alternatively, you can format the date returned from the dbselect command with the time command:
{dbselect: SELECT date FROM Table; space=4YUkK1sD0sfKTtSqXzy9x0; menu=yes}
{time: DD/MM/YYYY; at={=date}}
There can be other situations that may require a different approach, depending on how you fetch and use the date. If the options above don't work, please share a snippet showing how you get the DD/MM/YY format.
{note: preview=no}{dbselect: SELECT Name, Weight, VacDue, DOB, Age FROM Dogs; space=5vwhNpRFkSJQZTjwT9tdJJ; multiple=yes; menu=no; name=pups} {endnote: trim=yes}
Name {{^^%F0%9F%90%B6^^}} Age Weight DOB Vac Due
{repeat: for row in pups} {=row.name} {=row.age} {=row.weight} {=row.dob} {=row.vacdue}{endrepeat}
Does datetimeformat option work? I assume DOB field is date field in your example:
{note: preview=no}{dbselect: SELECT Name, Weight, VacDue, datetimeformat(DOB, "DD/MM/YY") as DOB, Age FROM Dogs; space=5vwhNpRFkSJQZTjwT9tdJJ; multiple=yes; menu=no; name=pups} {endnote: trim=yes}
Name {{^^%F0%9F%90%B6^^}} Age Weight DOB Vac Due
{repeat: for row in pups} {=row.name} {=row.age} {=row.weight} {=row.dob} {=row.vacdue}{endrepeat}
dob and vacdue are the date fields. Do I need to add the SELECT datetime format ........ as a seperate dbselect command. Sorry, I'm new to this
Try to copy and paste the snippet below into your snippet. You can use only one dbselect command, just replace your existing dbselect with the one below.
{note: preview=no}{dbselect: SELECT Name, Weight, datetimeformat(VacDue, "DD/MM/YY") as VacDue, datetimeformat(DOB, "DD/MM/YY") as DOB, Age FROM Dogs; space=5vwhNpRFkSJQZTjwT9tdJJ; multiple=yes; menu=no; name=pups} {endnote: trim=yes}
Name {{^^%F0%9F%90%B6^^}} Age Weight DOB Vac Due
{repeat: for row in pups} {=row.name} {=row.age} {=row.weight} {=row.dob} {=row.vacdue}{endrepeat}
Thank you. The dbselect formula worked in converting the dates. The table section didn't work but using the original table section with it works. Thank you for your perseverance.