Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Date() Disabled???

Author  Topic 

neutcomp
Posting Yak Master

111 Posts

Posted - 2003-10-09 : 09:35:42
Is It possible that the function date() is disabled on a computer?
Because I have a query and it tells me:
This function is not available for this expression. The field is a date/time field and the notation is short date (16-09-1994).

My other question is that is it true that access does not understand getDate() ? Because I was looking for a other way to get the current date.

And last but not least can you tell date() to give the date back in a order you define like dd/mm/yyyy and not mm/dd/yyyy. I know from ASP you can say Session.LCID = 1043 and then every date he handles like the dutch standaard. dd-mm-yyyy.

Thanxx
Bjorn

Here is the query:


SELECT Relaties.Id, Relaties.Zoeksleutel, Relaties.Postcode, TakenRapportage.Taakuitgevoerd, TakenRapportage.Taaktijd, [Medium activiteiten].Activiteiten, TakenRapportage.Taakdatum, [Medium CRM].TeamledenWachtwoord
FROM Relaties INNER JOIN (Rapportage INNER JOIN ([Medium CRM] INNER JOIN ([Medium activiteiten] INNER JOIN TakenRapportage ON [Medium activiteiten].IdActiviteiten = TakenRapportage.TaakActiviteit) ON [Medium CRM].IdTeamleden = TakenRapportage.TaakCRM) ON Rapportage.IdRapportage = TakenRapportage.IdTaakConnectie) ON Relaties.Id = Rapportage.IdRapportageRelatie
WHERE (((TakenRapportage.Taakuitgevoerd) Is Null)
AND ((TakenRapportage.Taakdatum)=Date())
AND (([Medium CRM].TeamledenWachtwoord)=[Forms]![Relaties]![txtwachtwoord]));

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-10-09 : 10:26:00
use the now() function.

dates are returned as values -- not in any format. formatting is something you do when you display the date. if you wish to format the dates when you display them, use the "format" property on report or form fields when you display your data. or you can use the FORMAT() function.

- Jeff
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2003-10-10 : 08:19:48
FYI

You Can only use Getdate() if you have a SQL backend.

If you do have a SQL backend I would use Getdate() in a SP rather than Now() in a application. Reason being Getdate() comes from the Servers CLock and Now() comes from the remotes clock.




Jim
Users <> Logic
Go to Top of Page

jhermiz

3564 Posts

Posted - 2003-10-25 : 23:08:46
quote:
Originally posted by jsmith8858

use the now() function.



Absolutely a no no. Now returns the date and time and must be formated. The function date() works perfectly fine and returns just that, a date. If it is not working for you, you're just missing a reference. Open your vb code and click on tools->references and uncheck any of the references that may be "MISSING".

Jon
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-10-26 : 07:47:18
<A bit off the topic>
Always declare explicitly a query's parameters. Like this:

PARAMETERS [Forms]![Relaties]![txtwachtwoord] TEXT;
SELECT ...
... ...
;
Go to Top of Page

jhermiz

3564 Posts

Posted - 2003-10-26 : 12:04:14
I thought this was access? You don't do that in access.

Go to Top of Page

jhermiz

3564 Posts

Posted - 2003-10-26 : 12:04:16
I thought this was access? You don't do that in access.

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-10-26 : 12:08:04
try it ! see what happens. you might be surprised ;)

- Jeff
Go to Top of Page
   

- Advertisement -