Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?




"LibbyChantel" <LibbyChantel@xxxxxxxxx> wrote in message news:1146065213.847047.119090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You guys are totally missing the point.

I'm not totally following either.

My question is not how to
format a date to use it in SQL, which is why I left that information
out originally. My question was, is there a way to save only a portion
of a date in a Date object?

No, there isn't.


My solution is to extend the Date Object and add a field to it which
denotes whether the entire date is valid, or just some combination of
mm/yyyy, etc But I thought maybe there was a way to use the original
Date object without "enhancing" it. I am REQUIRED to store the date in
a Date, even if it is invalid : )

Careful the way you phrase this. You say you're "required to store the date in a Date", but might your requirements be "store the date", without regards of the actual class where the Date is stored?

If you really do need to use the Date object, you're out of luck. The date object simply doesn't support what you want. Even if you extend the Date object to add functionalities, when you pass that Date object to an SQL database, the database isn't going to know about your extended functionalities, and will simply store Dates the way it always has.

You should probably go a level higher in abstraction, and describe what you're trying to do, rather than describe how you want to do it.

- Oliver

.



Relevant Pages

  • Re: Problems with querying date field
    ... >> If you want to put a database somewhere for safekeeping, ... database - SQL isn't about persistence, ... says nothing about the physical storage media to be used. ... store data on a tape, or a disk, or a CD, or a file, or any physical ...
    (microsoft.public.sqlserver.programming)
  • Re: Should I place a Domain controller in each of the 40 stores?
    ... They should be able to do that, one common way is to use a SQL account in an mixed SQL authentication enviroment where the Apps use a dedicated local SQL account to connect to the DB, but again the app may work differently. ... Also note that although it is possible, it's NOT recommended to cluster for example a SQL server that is also a DC. ... We plan to place a SQL server in each store as part of a new POS ... implementation and also migrate to XP Embedded for the POS terminals. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Relational database & OO
    ... And when was the last time you saw an RDB that stored a telephone ... The modern relational theory permits to store values of user-defined type: ... Neither do the relational model or SQL. ... Your comprehension of the SQL database performance is not good. ...
    (comp.object)
  • Event log errors after moving sharepoint 3.0 database
    ... After following a procedure to move the location of the SQL databases from ... SQL Database 'WSS_Content' on SQL Server instance ... The local computer may not have the necessary registry ... information or message DLL files to display messages from a remote computer. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Need Aggregate Query Help!!!
    ... else than what I am suggesting. ... I was using Access SQL with JET backend. ... (SELECT EmpName, Store, SUM(Qty) ... GROUP BY EmpName, Store) as B ...
    (microsoft.public.access.queries)