Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

IIF Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geek - 07 Dec 2005 05:30 GMT
hi,
  i'm currently using the IIF statement to extract the dates out as shown
below:
"
IIf([dbo_currency].[curr_code]='sgd',#1/1/2001#,[Forms]![Year_Month_M]![cur-month] & "/" & [Forms]![Year_Month_M]![cur-year]) "

before extracting the dates out from the SQL server, the date was in this
format: "8/1/2003 9:00:00 AM".

to get the dates only, i used "date: Left([eff_date],9)" code to return me
the date value. however when i go on to match the form's date to the iif
function, the value that got out was only one date and the date that was
being called out does not match the date that i've selected on the form.

fyi: the date that got out was "1/1/2001"

please help! and thanks alot!
JimS - 07 Dec 2005 15:45 GMT
Why aren't you using standard Access Date functions to extract the dates?
Using string functions can get you in trouble since the dates can vary in
length...
Signature

Jim

> hi,
>    i'm currently using the IIF statement to extract the dates out as shown
[quoted text clipped - 13 lines]
>
> please help! and thanks alot!
Tim Ferguson - 07 Dec 2005 16:32 GMT
>  i used "date: Left([eff_date],9)" code to return me
> the date value

If you have to use strings-as-dates, then you really have to format them in
ISO standard yyyy-mm-dd otherwise you won't have any chance of sorting or
comparing them.

B Wishes

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.