[OPEN-ILS-GENERAL] MS SQL

Mike Rylander mrylander at gmail.com
Fri Aug 1 11:53:47 EDT 2008


On Fri, Aug 1, 2008 at 11:24 AM, Jillian Lashmett
<jlashmet at cumberland.lib.nc.us> wrote:
> Calling all database geeks!
>
> PROBLEM: working with MS SQL, how do you change the definition of the day by
> time so that when you pull records from a certain span of days it will
> retrieve everything cover in those days. Or can you redefine the day?

Well, Evergreen doesn't (can't) use MS SQL Server, if that's what you
mean by MS SQL.  Are you referring to an ODBC connection through
Access or some other MS product?

>
> EXAMPLE: You try to pull records added from Monday-Friday. The database is
> retreiving records created from Monday at midnight until Friday at midnight,
> thus not giving records that were created on Friday.
>
> Can you change this so that when you ask for Monday-Friday you can get all
> of the records that were created on these days?
>
> I suppose one solution would be to request Monday-Saturday, but it needs to
> be user-friendly and not confusing to people who do not work with the
> database regularly.

If you cast the column to a DATE then your query will be inclusive of
the full day of Friday.  The standard SQL syntax for this would be:

  CAST( <column_name> AS DATE )

though I'm not familiar with how you would do this through a graphical
ODBC-based tool.  I hope that points you in the right direction.

-- 
Mike Rylander
 | VP, Research and Design
 | Equinox Software, Inc. / The Evergreen Experts
 | phone: 1-877-OPEN-ILS (673-6457)
 | email: miker at esilibrary.com
 | web: http://www.esilibrary.com


More information about the Open-ils-general mailing list